pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaloyan Iliev Iliev <news1@faith.digsys.bg>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problems with UNION ALL and ORDER BY
Date: Mon, 02 Aug 2004 19:39:30 +0300
Message-ID: <410E6E42.6030206@faith.digsys.bg> (raw)
In-Reply-To: <10984.1091464511@sss.pgh.pa.us>
References: <410E6376.1010404@faith.digsys.bg>
	<10984.1091464511@sss.pgh.pa.us>

Dear Tom,

As I say in my previous letter I am using 7.2.3. If you wish I can show 
you the query and the result to see for yourself, that there is 
something wrong. It just don't order the overall result but the separate 
results of the both subqueries.

Tom Lane wrote:

>Kaloyan Iliev Iliev <news1@faith.digsys.bg> writes:
>  
>
>> I have the following problem:
>>    
>>
>
>  
>
>>select
>>.....
>>from
>>....
>>where
>>....
>> UNION ALL
>>    
>>
>
>  
>
>>select
>>...
>>from
>>....
>>where
>>....
>>ORDER BY field1
>>    
>>
>
>  
>
>>But the the order by doesn't work properly. It returns the rows of the 
>>first query ordered and then appends the rows of the second query 
>>ordered.
>>    
>>
>
>Pray tell, what Postgres release are you using?
>
>AFAICT this will result in an overall sort in all PG releases since 7.0.
>I don't have anything older to test...
>
>			regards, tom lane
>
>
>  
>



view thread (7+ messages)  latest in thread

Message-ID: <410E6E42.6030206@faith.digsys.bg>
Permalink:  ../410E6E42.6030206@faith.digsys.bg/
Also on:    postgresql.org/message-id/410E6E42.6030206@faith.digsys.bg

 · 

reply

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: news1@faith.digsys.bg, tgl@sss.pgh.pa.us
  Subject: Re: Problems with UNION ALL and ORDER BY
  In-Reply-To: <410E6E42.6030206@faith.digsys.bg>

* 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