: [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
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.
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
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
|
| cc:
|
| Subject: Re: [GENERAL] select distinct w/order by
|
>
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
"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
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