Re: [GENERAL] UNION help

2007-05-18 Thread Dann Corbit
7 12:11 PM To: pgsql-general@postgresql.org Subject: [GENERAL] UNION help 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?

Re: [GENERAL] UNION help

2007-05-17 Thread Scott Marlowe
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 tabl

Re: [GENERAL] UNION help

2007-05-17 Thread Ben
You could modify the queries and then do a union all... but then you may see the same result from each part of the union. Which may or may not be a problem for you. On Thu, 17 May 2007, Robert James wrote: Is there anyway to tell if the records in a union came from the 1st query or the second

[GENERAL] UNION help

2007-05-17 Thread Robert James
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?