Re: [GENERAL] select distinct w/order by

2004-04-06 Thread John Liu
: [GENERAL] select distinct w/order by On Wed, 31 Mar 2004, Tom Lane wrote: > "John Liu" <[EMAIL PROTECTED]> writes: > > The original simple SQL - > > select distinct atcode from TMP order by torder; > > This is not "simple", it is "broken SQ

Re: [GENERAL] select distinct w/order by

2004-04-06 Thread John Liu
u; [EMAIL PROTECTED] Subject: Re: [GENERAL] select distinct w/order by On Wednesday 31 March 2004 18:50, John Liu wrote: > I know this is an old topic, but it's not easy to find a way around it, so > when we migrate SQL from other database to PostgreSQL, it causes a huge > headache.

Re: [GENERAL] select distinct w/order by

2004-04-06 Thread John Liu
2004 4:35 PM To: Tom Lane Cc: John Liu; [EMAIL PROTECTED] Subject: Re: [GENERAL] select distinct w/order by On Wed, 31 Mar 2004, Tom Lane wrote: > "John Liu" <[EMAIL PROTECTED]> writes: > > The original simple SQL - > > select distinct atcode from TMP order by torder

Re: [GENERAL] select distinct w/order by

2004-03-31 Thread scott.marlowe
On Wed, 31 Mar 2004, Tom Lane wrote: > "John Liu" <[EMAIL PROTECTED]> writes: > > The original simple SQL - > > select distinct atcode from TMP order by torder; > > This is not "simple", it is "broken SQL with an undefined result". > > If DISTINCT merges multiple rows with the same atcode, how a

Re: [GENERAL] select distinct w/order by

2004-03-31 Thread Bob . Henkel
| | cc: | | Subject: Re: [GENERAL] select distinct w/order by | >

Re: [GENERAL] select distinct w/order by

2004-03-31 Thread Stephan Szabo
On Wed, 31 Mar 2004, John Liu wrote: > I know this is an old topic, but it's not easy to find a way around it, so > when we migrate SQL from other database to PostgreSQL, it causes a huge > headache. Here's an extremely simple example - > > The original simple SQL - > select distinct atcode from T

Re: [GENERAL] select distinct w/order by

2004-03-31 Thread Tom Lane
"John Liu" <[EMAIL PROTECTED]> writes: > The original simple SQL - > select distinct atcode from TMP order by torder; This is not "simple", it is "broken SQL with an undefined result". If DISTINCT merges multiple rows with the same atcode, how are we supposed to know which row's value of torder t

Re: [GENERAL] select distinct w/order by

2004-03-31 Thread Richard Huxton
On Wednesday 31 March 2004 18:50, John Liu wrote: > I know this is an old topic, but it's not easy to find a way around it, so > when we migrate SQL from other database to PostgreSQL, it causes a huge > headache. Here's an extremely simple example - > > The original simple SQL - > select distinct a