Re: UNION help

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Robert James <srobertjames(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UNION help
Date: 2007-05-17 19:33:56
Message-ID: 464CAE24.9020306@g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Robert James wrote:
> Is there anyway to tell if the records in a union came from the 1st
> query or the second?
> Can I modify the individual queries to let me know this?
You can do something like:

select 'set1' as identifier, field1, field2 from table1
union
select 'set2', field1, field2 from table2

In response to

  • UNION help at 2007-05-17 19:11:15 from Robert James

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2007-05-17 19:51:22 Re: Vacuum non-clustered tables only
Previous Message Ben 2007-05-17 19:24:44 Re: Installing contrib / fuzzystr