Re: [HACKERS] DISTINCT and ORDER BY bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] DISTINCT and ORDER BY bug?
Date
Msg-id 13920.949905403@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] DISTINCT and ORDER BY bug?  (Don Baccus <dhogaza@pacifier.com>)
Responses Re: [HACKERS] DISTINCT and ORDER BY bug?
List pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes:
> At 12:26 AM 2/7/00 -0500, Tom Lane wrote:
>> It would be interesting to poke at Oracle to find out just what they
>> consider a legitimate ORDER BY expression for a SELECT DISTINCT.

> I have full-time access to an Oracle installation, so fire away
> regarding examples and questions.

Well, try these on for size:
select distinct x from foo order by x+1;
select distinct x+1 from foo order by x+1;
select distinct x+1 from foo order by x;
select distinct x+1 from foo order by x+2;
select distinct x+y from foo order by x+y;
select distinct x,y from foo order by x+y;
select distinct x+y from foo order by x,y;
select distinct x+y from foo order by x-y;

A human can easily see that all but the last two are well-defined,
but I'll be a little surprised if Oracle knows it...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] DISTINCT and ORDER BY bug?
Next
From: Timothy Dyck
Date:
Subject: follow-up on PC Week Labs benchmark results