Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: subqueries?
This is not particulary pretty or efficient, but I it should do what you
want.
SELECT t1.primarykey, t1.value1, t1.value2, t2.value1, t2.value2 FROM ( SELECT value1, value2 FROM table1 WHERE ... GROUP BY ... ) t1, ( SELECT value1, value2 FROM table2 WHERE ... GROUP BY ... ) t2
On Wed, 12 Jan 2000, Richard Price wrote:
> 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 - 13:21:13 CST
![]() |
![]() |