Re: [SQL] Aggregate query for multiple records

2004-08-28 Thread Josh Berkus
Scott, > Unfortunately, your revised query works like a charm except for the > fact that prd_data."date" - prd2."date" + 1 give incorrect values when > the year wraps, see in the output below. Need to conditionally > subtract 88 from the date or use an incrementing count() function > instead of d

Re: [SQL] backup of a specific schema

2004-08-28 Thread Kenneth Gonsalves
On Saturday 28 August 2004 06:18 pm, Gaetano Mendola wrote: > | > | backup/restore > > Well, that chapter speak about pg_dump, don't you had the curiosity > to look at the complete options for that command ? :-) yes. so i looked in the book from which i was learning postgres. it gave about 3 opt

Re: [SQL] Aggregate query for multiple records

2004-08-28 Thread Scott Gerhardt
Greg Stark <[EMAIL PROTECTED]> writes: [ nice example snipped ] ... Also, you'll have to change it to use reals. That part, at least, can be worked around as of 7.4: use polymorphic functions. You can declare the functions and aggregate as working on anyelement/anyarray, and then they will automa

Re: [SQL] Aggregate query for multiple records

2004-08-28 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > [ nice example snipped ] > ... Also, you'll have to change it to use reals. That part, at least, can be worked around as of 7.4: use polymorphic functions. You can declare the functions and aggregate as working on anyelement/anyarray, and then they will au

Re: [SQL] from PG_DUMP to CVS

2004-08-28 Thread Philip Warner
At 02:02 AM 28/08/2004, Josh Berkus wrote: some-dbname/some-schema/TABLES/sometable.sql some-dbname/some-schema/VIEWS/someview.sql some-dbname/some-schema/FUNCTIONS/somefunction-param{codes}.sql some-dbname/some-schema/TYPES/sometype.sql some-dbname/some-schema/OPERATORS/OPsomeoperator.sql In this

Re: [SQL] backup of a specific schema

2004-08-28 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kenneth Gonsalves wrote: | On Saturday 28 August 2004 07:46 am, Gaetano Mendola wrote: | |>Kenneth Gonsalves wrote: |> |>>On Friday 27 August 2004 01:17 pm, Michalis Kabrianis wrote: |>> |>>>Kenneth Gonsalves wrote: |>>> |hi, |is there anyway to

Re: [SQL] Aggregate query for multiple records

2004-08-28 Thread Greg Stark
Scott Gerhardt <[EMAIL PROTECTED]> writes: > Hello, I am new to the list, my apology if this question is beyond the scope or > charter of this list. > > My questions is: > What is the best method to perform an aggregate query to calculate sum() values > for each distinct wid as in the example be