Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL: calculations with un-joined table

SQL: calculations with un-joined table

From: Mark Aurit <mark_aurit_at_mail.northgrum.com>
Date: Thu, 22 Oct 1998 22:19:09 GMT
Message-ID: <362faf25.24693247@news.northgrum.com>


I an trying to figure out how to use an element from a table in a calculation, where the tables aren't joinable.

Simplistically, I have a "Travel" table as follows: create table trip_master
(trip_taker varchar2(10),

daily_miles_driven number(6))

and a "Travel Parameter" table as follows: create table trip_parm
(annual_mileage_amount number(4,2))

I want to create a view summarizing the first table, while calculating the trip reimbursement.

So Ive tried

select t.trip_taker,sum(t.daily_miles_driven),

        sum(t.daily_miles_driven)* MAX(p.annual_mileage_amount) from trip_taker t,table trip_parm p
group by t.trip_taker

But that obviously doesnt work, and Im now sure how to work this.

Any help greatly appreciated.
Mark
mark_aurit_at_mail.northgrum.com Received on Thu Oct 22 1998 - 17:19:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US