Re: [SQL] reduce many loosely related rows down to one

2013-05-28 Thread Bill MacArthur
On 5/28/2013 11:04 AM, Torsten Grust wrote: On 25 May 2013, at 9:19, Bill MacArthur wrote (with possible deletions): [...] select * from test; id | rspid | nspid | cid | iac | newp | oldp | ppv | tppv +---+---+-+-+--+--+-+- 1 | 2 | 3

Re: [SQL] reduce many loosely related rows down to one

2013-05-27 Thread Bill MacArthur
On 5/25/2013 7:57 AM, Marc Mamin wrote: Von: pgsql-sql-ow...@postgresql.org [pgsql-sql-ow...@postgresql.org]" im Auftrag von "Bill MacArthur [webmas...@dhs-club.com] Gesendet: Samstag, 25. Mai 2013 09:19 An: pgsql-sql@postgresql.org Bet

[SQL] reduce many loosely related rows down to one

2013-05-25 Thread Bill MacArthur
xperimented with doing the aggregates as a CTE and then joining that to various incarnations of DISTINCT and DISTINCT ON, but those do not do what I want. Trying to find the right combination of terms to get an answer from Google has been unfruitful. Any ideas? Thank you for your considerati