Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting results for multiple queries in Pro C
On Wed, 21 Jan 1998 18:37:25 -0600, ajaysn_at_hotmail.com wrote:
>I need to merge results from multiple queries together.
>Is there some way I can pass multiple queries to the server
>and get results of them as if only one query is passed (i.e.
>the database will just concatenate the results of multiple queries).
>All the queries result in similar row type.
>
>Thanks for any information. Please email me at ajaysn_at_hotmail.com
>
>-Ajay
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
select a, b, c from T1
UNION ALL
select d, e, f from T2
UNION ALL
select g, h, i from T3
will do it. Make sure you use UNION ALL, not just UNION. A union all just concatenates the results, a UNION would give you everything from T1, everything in T2 not in T1, everything in T3 not in T1+T2 -- eg: different then T1+T2+T3.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Jan 22 1998 - 00:00:00 CST