Re: union query format - Mailing list pgsql-sql

From Josh Berkus
Subject Re: union query format
Date
Msg-id web-1386026@davinci.ethosmedia.com
Whole thread Raw
In response to union query format  (Robert Wynter <rgwynter@rci.rogers.com>)
List pgsql-sql
On Fri, 26 Apr 2002 15:46:21 -0400Robert Wynter <rgwynter@rci.rogers.com> wrote:
> Hi Josh,
> Thanks for the help.
> 
> Question, How do I format in a union query. Is there a SELECT SQL
> code I
> could use. I've been trying to find internet code examples to find
> that out.

Just like you would in a regular query.  

SELECT to_char(sub_date, 'YYYY-MM-DD') as entry, adv, etc ....
UNION ALL
SELECT mps, adv, etc .....

(I generally use UNION ALL because it doesn't require the DB to test
for uniqueness and thus runs faster in cases where I expect all rows to
be unique anyway).

-Josh




pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Wierd query behaviour
Next
From: Ron Peterson
Date:
Subject: Re: Connection authentication