distinct. Is this the correct behaviour? - Mailing list pgsql-hackers

From Vince Vielhaber
Subject distinct. Is this the correct behaviour?
Date
Msg-id XFMail.991020195649.vev@michvhf.com
Whole thread Raw
Responses Re: [HACKERS] distinct. Is this the correct behaviour?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Is this the way distinct is supposed to work?  My intent is to give
only one for each different value of x - like it does in the first
distinct example.  But when order by is added for the date/time sort
I get what you see in the second distinct example.

pop4=> select * from foo;
x|y                           
-+----------------------------
1|Wed Oct 20 06:29:41 1999 EDT
1|Wed Oct 20 06:29:42 1999 EDT
1|Wed Oct 20 06:29:43 1999 EDT
1|Wed Oct 20 06:29:48 1999 EDT
(4 rows)

pop4=> select distinct x from foo;
x
-
1
(1 row)

pop4=> select distinct x from foo order by y;
x
-
1
1
1
1
(4 rows)



Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev@michvhf.com   flame-mail: /dev/null # include <std/disclaimers.h>       Have you
seenhttp://www.pop4.net?       Online Campground Directory    http://www.camping-usa.com      Online Giftshop
Superstore   http://www.cloudninegifts.com
 
==========================================================================




pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: PostgreSQL Perl Module
Next
From: Bruce Momjian
Date:
Subject: New psql startup banner