From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz>
Cc: Rajesh Kumar Mallah. <mallah@trade-india.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: why the difference?
Date: Thu, 21 Nov 2002 09:47:20 -0500
Message-ID: <11686.1037890040@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0211210936330.11841-100000@server>
References: <Pine.LNX.4.44.0211210936330.11841-100000@server>
Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz> writes:
> the where clause is evaluated before the distinct clause, so your queries
> aren't equivalent because you switched the order by splitting the query
> into two queries...
Besides which, SELECT DISTINCT ON is order-sensitive. If you don't use
an ORDER BY with it, you are going to get rather unpredictable results.
See the example on the SELECT reference page.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, jouh8664@ss1000.ms.mff.cuni.cz, mallah@trade-india.com
Subject: Re: why the difference?
In-Reply-To: <11686.1037890040@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox