sorry, only a private replay and not to the list
-- Ursprüngliche Nachricht --
Von: Andreas Kretschmer
An: Antonio Parrotta
Datum: 28. Dezember 2012 um 15:19
Betreff: Re: [SQL] sql basic question
Hi,
your question was: "What I want to achieve is a result table with min an
gt; 12 | 23434 | 0.88764543364566 |0 *M
> 33 | 23434 | 0.23235478697988 |1 *m/M
> 14 | 129007 | 0.63454675634756 |0 *m
> 19 | 129007 | 0.97897897897654 |0 *M
> 13 | 129007 | 0.22345364656788 | 1 *m
> 11 | 129007 | 0.867878
JORGE MALDONADO hat am 24. Dezember 2012 um 17:30
geschrieben:
> I have a record with the following fields:
>
> id1, id2, id3, id4, price1, price2, price3, price4
>
> I would like to write a SELECT statement in order to get 4 records:
>
> id, price (record that comes from id1 and price 1)
> id,
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> Hi,
>
> I need to store data that has a valid timespan with start and enddate.
>
> objects ( id, name, ... )
> object_data ( object_id referencs objects(id), startdate, enddate, ... )
>
> nothing special, yet
>
> How can I have PG reject a
Sofer, Yuval wrote:
> Hi,
>
>
>
> I am using Postgres DB with stand by database, configured with streaming in
> synchronized mode (each commit on primary DB waits for commit on secondary
> DB).
>
>
>
> Sometimes we suffer from network issues and as consequences, secondary machine
> is no
Kaleeswaran Velu wrote:
> Hi Team,
> I am using PostgreSQL 9.2.3 in Windows platform. I have created two databases
> in it. Now I want to refer the tables across the databases. Meaning would like
> to create Database link. Can anyone guide me on how to create a DB link?
You can use db_link, see
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Hi list,
>
> It is possible to retrieve the MAC Address of a computer using a Postgresql
> function like others:
In the same subnet? Then you can use untrusted languages such as plperlu
or plsh to retrieve the MAC for a IP. (arp -a ip)
Judith <[EMAIL PROTECTED]> schrieb:
> Hello everybody!! I have a field type text with folios like this:
> A98526
>
> but I want to change de A for a 0 like this: 098526, exists a way to do
> this in a query???
Perhaps something like this:
test=# select regexp_replace('A98526', '
Felix Zhang <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I want to split a table to 2 small tables. The 1st one contains 60% records
> which are randomly selected from the source table.
> How to do it?
Why do you want to do this?
Andreas
--
Really, I'm not out to destroy Microsoft. That will just
Felix Zhang <[EMAIL PROTECTED]> schrieb:
> Hi all,
>
> I'm a newbie of PostgreSQL. I'm searching materials about porting from Oracle
> to PostgreSQL.
> Anyone can share with me some good documatations?
http://techdocs.postgresql.org/#convertfrom
Andreas
--
Really, I'm not out to destroy Micr
ivan marchesini <[EMAIL PROTECTED]> schrieb:
> Dear all...
> I have created a check constraint without giving it a name..
> now I have a check named "$25" in my table that I need to drop or
> modify!!!
> How can I do???
Can you see the name with \d within psql?
An example:
test=# create table
ivan marchesini <[EMAIL PROTECTED]> schrieb:
> .
> or it depend on the fact I'm using postgres 7.4.13
> many thanks...
Maybe, the information-schema can be different in different versions.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional sid
Richard Broersma Jr <[EMAIL PROTECTED]> schrieb:
> > Hi guys,
> >
> >Am new to sql scripting so this might be a stupid question. Am getting
> > an error while trying
> > to do the following
> >
> > SELECT INTO svc_data_rec * from svc_tbl_name where 'uid' = sub_id;
> >
> > where svc_data_
Adrian Klaver <[EMAIL PROTECTED]> schrieb:
> On Thursday 23 November 2006 08:45 pm, Tom Lane wrote:
> > Mulham freshcode <[EMAIL PROTECTED]> writes:
> > > execute sql_str1 into svc_data_rec ;
> > >
> > > svc_data_rec is a RECORD, which is supposed to be dynamic.
> >
> > This should work --- in PG
Jeff Herrin <[EMAIL PROTECTED]> schrieb:
> I am returning results ordered randomly using 'order by random()'. My issue
> has
> to do with page numbers in our web application. When I hit the 2nd page and
> retrieve results with an offset, ordering by random() isn't really what I want
> since I wil
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Hi list,
>
> Here in my country (Brazil) we have the decimal simbol as ' , ' (commas) and
> thousand separator as ' . ' (point)
>
> Here my sql uses: to_char(sum(My_column), '0D00')
>
> Is there any way to make this happens ?
I t
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> I mean really deadlock. Other transactions can't access the database until the
> main transaction is complete. A question:
That's not true.
>
> PostgreSQL doesn't permit multiple transactions concurrently ?
Why not? Show us a complete
Louis-David Mitterrand <[EMAIL PROTECTED]> schrieb:
> ballet,etc.) and I am looking for a select that can return the 10 last
> entered shows AND at most 2 of each type. Is that possible in one query?
A similar question i found in the archive and there are a couple of
answers: (for the second par
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Thank you but I must inc an specific row. How to do that ?
Read the answer again.
Please, no silly TOFU (german synonym for text above, fullquote below).
> >> For example. I have a table with a field that on each update it
> >> incremen
Richard Broersma Jr <[EMAIL PROTECTED]> schrieb:
> --- Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote:
>
> > Thank you but I must inc an specific row. How to do that ?
> >
>
> Does,
>
> UPDATE your_table
> SET your_row = your_row +1
> WHERE your_pkey = ;
>
> not do what you need?
I th
chester c young <[EMAIL PROTECTED]> schrieb:
> trying to do something like
>
> select d.day,
>c.name
> from [dates between day1 and day2] d
> left join c.some_table;
>
> but cannot figure out what to put into the brackets.
Perhaps something like this:
test=# select curre
Pablo Barrón <[EMAIL PROTECTED]> schrieb:
>
> Hi!
>
> I'm trying to order a list in which the first parameter to order is a
> specific
> field, and the second should vary depending on a specific condition. More
> explicit, I would like to do something like:
>
> - ORDER BY a.column1, [b.colu
Gerardo Herzig <[EMAIL PROTECTED]> schrieb:
> Thanks! But now i have another problem related with count():
>
> select page_id, word, word_position, count(page_id) from (select * from
> search_word('word1', 'table1') union search_word('word2', 'table2')) foo
> group by page_id;
>
> and gives me
Karthikeyan Sundaram <[EMAIL PROTECTED]> schrieb:
>
> Hi,
>
> I am having a requirement here.
>
> 1) I need to write a plpgsql function where it takes the input
> parameter of a structure of a table.
Because? To build this table? You can pass an ascii-text
Stefan Zweig <[EMAIL PROTECTED]> schrieb:
> hi list,
>
> currently i am switching from mysql to pgsql, so i am a bit new to
> postgres' syntax.
You are welcome.
>
> at the moment i am looking in postgres for something which is similar
> to SHOW INDEX FROM [table] in mysql. unfortunately i coul
John Gunther <[EMAIL PROTECTED]> schrieb:
> I've tried everything I can think of here to join records when the join
> table varies and is named in the primary record, but to no avail. Here's an
> example with all non-essentials stripped out.
>
> I have 3 tables:
>
> create table zip (
> id se
Stefan Arentz <[EMAIL PROTECTED]> schrieb:
> I need to get statistics from a bunch of tables. Simply the number of
> records in them.
>
> The query plan looks like this:
>
> => explain select count(id) from stuff;
> QUERY PLAN
> ---
Andreas Joseph Krogh <[EMAIL PROTECTED]> schrieb:
> Hi all. Any hint on how to format this interval as number of hour/seconds etc?
> select age('2007-09-22 17:00'::timestamp, '2000-02-20 18:00'::timestamp);
> age
> ---
> 7 years 7 mons 1 day 23:00:00
You
Tore Lukashaugen <[EMAIL PROTECTED]> schrieb:
> Hello all,
>
> I have an application running against my postgres 8.2 database (on Windows
> Vista) for which I do not have access to the source code.
>
> I would like to know what SQL statements are being executed by the
> application. Is there a
Markus Schaber <[EMAIL PROTECTED]> schrieb:
> > is there any way to get both results in a single query,
> > eventually through stored procedure?
> > The retrieved [count(*),A] ; [count(*),B)] data couldnt fit
> > on a single table, of course.
> >
> > The main goal would be to get multiple results
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I have a column with the datatype "text" that may contain leading
> whitespace (tabs, spaces newlines, ...) and I would like to remove them all
> (ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' fr
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Andreas Kretschmer wrote on 28.10.2007 12:42:
> >>I have a column with the datatype "text" that may contain leading
> >>whitespace (tabs, spaces newlines, ...) and I would like to remove them
> >>all
Sabin Coanda <[EMAIL PROTECTED]> schrieb:
> Hi there,
>
> Is it possible to execute a system command from a function ? (e.g. bash )
Yes, of course, but you need an untrusted language like pl/perlU oder
plsh. http://plsh.projects.postgresql.org/
Andreas
--
Really, I'm not out to destroy Micros
Stefan Scheidegger <[EMAIL PROTECTED]> schrieb:
> An example to explain my Problem: Lets say I have a table containing
> information about the customer (name, address, ...) and about his
> order (pieces, product-name, price). Because one customer can order
> several products I split the table into
Philippe Lang <[EMAIL PROTECTED]> schrieb:
2 ways:
* You can use something like this:
test=*# select * from a;
id | val
+-
1 | foo
2 | bar
(2 rows)
test=*# select array_to_string(array(select val from a), ', ');
array_to_string
-
foo, bar
(1 row)
* comma-aggrega
Patrick Scharrenberg <[EMAIL PROTECTED]> schrieb:
> Hi!
>
> I have a table where I repeatingly log the status of some service, which
> looks something like this:
>
> < timestamp, status >
>
>
> I'd like to merge this information to intervals where the service was up
> or down.
>
>
Patrick Scharrenberg <[EMAIL PROTECTED]> schrieb:
> Something like this
> select a, b , a*b as c from ta where c=2;
>
> But postgresql complains, that column "c" does not exist.
>
> Do I have to repeat the calculation (which might be even more complex
yes.
Andreas
--
Really, I'm not out to de
Nacef LABIDI <[EMAIL PROTECTED]> schrieb:
> Hi all,
>
> I am writing some functions with retrun type as a SETOF of a datatype that I
> have defined. How can I test them with a select statement.
> Doing select my_function(); return set valued function called in context that
> cannot accept a set
Tk421 <[EMAIL PROTECTED]> schrieb:
>I've got a problem with a function: It receives two parameters, the
> first, the table name, and the second, a where condition. The function
> looks like this:
>
>DECLARE
> cod bigint;
> query TEXT;
>
>BEGIN
> query = 'SELECT co
Louis-David Mitterrand <[EMAIL PROTECTED]> schrieb:
>
> But if I append this
>
>order by pt.type_fr = 'comédien';
>
> I get this error:
>
> ERROR: column "pt.type_fr" must appear in the GROUP BY clause or be
> used in an aggregate function
>
> It seems I am using pt.type_fr in
Scott Marlowe <[EMAIL PROTECTED]> schrieb:
> >> You can use a subquery like my example:
> >>
> >> test=*# select i, comma(t) from (select distinct i,t from foo) bar group
> >> by i;
> >> i | comma
> >> ---+-
> >> 1 | a, b, c
> >> (1 row)
> >>
> >> Time: 0.554 ms
> >> test=*# select i, c
Havasvölgyi Ottó schrieb:
> Hi,
>
> Let's assume I have a table (called tbl) with a column 'name' and an index on
> it.
> How to optimally find records whose name column begins with - say - "Pre"?
> I know it can be done with LIKE (WHERE name LIKE 'Pre%'), but will this use
> the
> index mentio
Carol Cheung wrote:
> Hi,
> I have a table called temp
>
> access_date | active | status
> -++
> 2009-02-01 | t | 15
> 2009-02-01 | f | 16
> 2009-02-02 | f | 17
> 2009-02-01 | t | 17
> 2009-02-02 | f | 21
> 2009-
DM wrote:
> Hi All,
>
> I have a table test with columns name and value
>
> test table
> name
> value
>
> It has around 500 rows.
>
> I added a new column id to the table,
>
> Table test
> id,
> name,
> value
>
> I am not sure how to insert numbers to my column id (1-500).
You can cr
101 - 144 of 144 matches
Mail list logo