Re: UNION and ORDER BY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Cool Screen <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UNION and ORDER BY
Date: 2002-11-07 20:57:45
Message-ID: 28930.1036702665@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cool Screen <cool_screen_name90001(at)yahoo(dot)com> writes:
> UNION apparently reorders all the rows of the result
> in their natural order

No. It sorts them so it can eliminate duplicate rows, as per spec.
Try UNION ALL if you just want the two subselect results concatenated.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Tkach 2002-11-07 21:01:56 Re: UNION and ORDER BY
Previous Message Tom Lane 2002-11-07 20:54:56 Re: Vacuum full?