Re: [HACKERS] distinct. Is this the correct behaviour? - Mailing list pgsql-hackers

From sszabo@bigpanda.com
Subject Re: [HACKERS] distinct. Is this the correct behaviour?
Date
Msg-id 199910210240.WAA12470@megazone.bigpanda.com
Whole thread Raw
In response to Re: [HACKERS] distinct. Is this the correct behaviour?  (Vince Vielhaber <vev@michvhf.com>)
Responses Re: [HACKERS] distinct. Is this the correct behaviour?  (Vince Vielhaber <vev@michvhf.com>)
Re: [HACKERS] distinct. Is this the correct behaviour?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
This seems to generally work in postgres for the simple cases I tried:select x from foo group by x order by min(y)

Now I don't know if there are any hidden gotchas in that (or wierdness
with the spec), but it also feels better to me than using distinct in this
case as well, because it seems to explicitly describe how you want y
ordered.

>Ok, well what I'm trying to do is write a web-based discussion forum.  I
>wanted to list the subjects in any particular forum, but also want them
>to be in the order in which they were first posted.  So if I have 10 
>comments on one subject which first started last month and the subject
>begun with a 'z', and another that was started today with the subject
>beginning with an 'A', I want the end result to be:
>
>zebras have stripes
>Always cross at the light
>
>as opposed to 10 lines about the zebras and only one on Always.  It
>seems elementary, but at the same time it seems complex.  Must mean
>it's time for bed.


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: [HACKERS] distinct. Is this the correct behaviour?
Next
From: Bruce Momjian
Date:
Subject: Re: [DOCS] Re: [HACKERS] Outline for PostgreSQL book