distinct. Is this the correct behaviour?

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: hackers(at)postgresql(dot)org
Subject: distinct. Is this the correct behaviour?
Date: 1999-10-20 23:56:49
Message-ID: XFMail.991020195649.vev@michvhf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)michvhf(dot)com flame-mail: /dev/null
# include <std/disclaimers.h> Have you seen http://www.pop4.net?
Online Campground Directory http://www.camping-usa.com
Online Giftshop Superstore http://www.cloudninegifts.com
==========================================================================

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-10-21 00:42:25 New psql startup banner
Previous Message Lamar Owen 1999-10-20 19:21:06 Re: PostgreSQL Perl Module