From: Jan Bakuwel <jan.bakuwel@greenpeace.org>
To: Phil Couling <couling@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Different order by behaviour depending on where clause?
Date: Sun, 30 Oct 2011 10:16:54 +1300
Message-ID: <4EAC6D46.1060602@greenpeace.org> (raw)
In-Reply-To: <CANWftz+4LefBCLigcyFY5L+0B6wTcKL9FzHC2QuaJvx7KZhT3g@mail.gmail.com>
References: <4EAA3550.7080609@greenpeace.org>
<CAFj8pRBRJkJS-KSOL-1wdnhmG4ZEv9LFfXmUZFxmzUfzA+ymgw@mail.gmail.com>
<CANWftz+4LefBCLigcyFY5L+0B6wTcKL9FzHC2QuaJvx7KZhT3g@mail.gmail.com>
Hi Phil,
Thanks for your reply.
On 28/10/11 23:25, Phil Couling wrote:
> Hi Jan
>
> It is my understanding that a select query without "order by" has an
> undefined order.
> Though I'm sure you understand the dangers of using something which is
> undefined, I'm going reiterate them here:
I think you might have misread my email, I'm quoting:
"I have a compound query with some grouping, having and order by's saved
as a view, say with name "myview".
So... I am using explicit order by's. The problem (now solved) was that
I somewhere subtle "hidden" in one of my subqueries, type casted a row
(varchar to int) but omitted to do the same one or two "levels up". This
messed up my sorting. Once I applied the type cast in every single bit
of statement or all (sub)selects, all was OK.
kind regards,
Jan
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: jan.bakuwel@greenpeace.org, couling@gmail.com, pavel.stehule@gmail.com
Subject: Re: Different order by behaviour depending on where clause?
In-Reply-To: <4EAC6D46.1060602@greenpeace.org>
* 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