Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: subqueries?
Hi,
you can use your 2 queries as views.
Try this:
select a.id, a.column1, a.column2,
b.column1, b.column2
from (select id, sum(column1) column1,
sum(column2) column2 from table1 group by id) a, (select id, sum(column1) column1, sum(column2) column2 from table2 group by id) b
Klaus
Richard Price <explore65_at_yahooo.com> schrieb in im Newsbeitrag:
204f4.53$kB3.3225_at_news.uswest.net...
> I have two SELECT statements built that each produce nice 2 column result
> sets. ( they are separate because they perform GROUP BY results
> differently) . How can I combine them with SQL? They each have an ID
field
> in common. I'd like to have a resulting table with the common ID and the
two
> attributes from each result set.
>
> It doesn't seem possible to build an over all SELECT statement that has a
> FROM clause that uses another SELECT statement as a target.
>
> Any ideas would be wonderful to hear. Also, is there another news group
> that would be more appropriate for this?
>
> Thanks!
> Richard
>
>
>
>
Received on Wed Jan 12 2000 - 14:16:17 CST