Re: UNION and ORDER BY - Mailing list pgsql-general

From Tom Lane
Subject Re: UNION and ORDER BY
Date
Msg-id 28930.1036702665@sss.pgh.pa.us
Whole thread Raw
In response to UNION and ORDER BY  (Cool Screen <cool_screen_name90001@yahoo.com>)
List pgsql-general
Cool Screen <cool_screen_name90001@yahoo.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuum full?
Next
From: "scott.marlowe"
Date:
Subject: Re: PostgreSQL on Linux and Solaris comparison