Re: "order by" weirdness - Mailing list pgsql-sql

From Dipankar Chakrabarti
Subject Re: "order by" weirdness
Date
Msg-id 19990927075232.4435.rocketmail@web117.yahoomail.com
Whole thread Raw
In response to "order by" weirdness  (Hein Roehrig <hein@acm.org>)
Responses Re: [SQL] Re: "order by" weirdness  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
>Hello,

Dear Hein,

What are you trying to do with order by max(date)?

Order by date will give proper result.  For that
matter group by clause already does ordering, no need
to put a order by there.

Regards,

Dipankar

>consider these three statements:
>
>create table t (id integer, date datetime ) ;
>select id from t group by id ;
>select id from t group by id order by max(date) ;
>
>Is it correct behavior that the second select returns
>one row where

>as the first select returns zero rows? 

>Thanks in advance for any help,
>Hein




__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com


pgsql-sql by date:

Previous
From: Hein Roehrig
Date:
Subject: "order by" weirdness
Next
From: Stuart Rison
Date:
Subject: Re: [SQL] comparing 2 tables. . .