pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Robert Wynter <rgwynter@rci.rogers.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: union query format
Date: Fri, 26 Apr 2002 13:42:53 -0700
Message-ID: <web-1386026@davinci.ethosmedia.com> (raw)
In-Reply-To: <44586AAA5ECBD511A6520004AC2589A652D827@rssesnexg.rogers.com>

On Fri, 26 Apr 2002 15:46:21 -0400
 Robert 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





view thread (3+ messages)  latest in thread

Message-ID: <web-1386026@davinci.ethosmedia.com>
Permalink:  ../web-1386026@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1386026@davinci.ethosmedia.com

 · 

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: josh@agliodbs.com, rgwynter@rci.rogers.com
  Subject: Re: union query format
  In-Reply-To: <web-1386026@davinci.ethosmedia.com>

* 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