Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL
A copy of this was sent to "Patrick Lanphier" <p-lanphier_at_psu.edu>
(if that email address didn't require changing)
On Fri, 19 Jun 1998 11:47:05 -0400, you wrote:
>Is it possible to join these two SQL statements without creating a cartesian
>join?
>
>SELECT fund, SUM(ACTUAL_HRS)
> FROM labor_to_date
> GROUP BY fund;
>
>SELECT fund, SUM(hours)
> FROM timecard
> WHERE timecard.month = 6
> GROUP BY fund;
>
>"Contracts" is a table you can use which lists all valid "fund" numbers.
>
>Patrick Lanphier
>
Inline views...
select a.fund, a.actual_hrs, b.hours
from ( select fund, SUM(ACTUAL_HRS) actual_hrs
FROM labor_to_date GROUP BY fund ) a, ( SELECT fund, SUM(hours) hours FROM timecard WHERE timecard.month = 6 GROUP BY fund ) b
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
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 Fri Jun 19 1998 - 20:54:21 CDT