Re: Subqueries in select statements

From: Øystein Johnsen <oystein_at_premium.no>
Date: Tue, 27 Apr 1999 21:30:45 +0200
Message-ID: <37261065.4E2CF2F4_at_premium.no>


Thanks a lot for your answer, I am new to Oracle's syntax, being a long term Microsoft user, but I am still a little lost.

To complicate matters, what I really need is this:

>select t1.col_a,
> t1.col_b,
> exp(isnull((select sum(log(t2.col_c)))
> from table2 t2
> where t1.id=t2.id and t2.date_column<t1.date_column)
>from table t1

I have found out the the equivalent for "isnull" is "nvl" and "log" is "ln", but the
datepart complicates things a bit.

What I am really doing here is that for each row in the outer table, I want the product of some factors in another table up to a date specified for each row.

Any help would be greatly appreciated.

-- 
¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸·´¯`·.¸¸·´¯`·.¸¸·´¯`·.¸¸·´¯`·.¸¸·´¯`·.¸¸·´


 The rules of morality are not the conclusion of
 our reason", David Hume

 Oystein Johnsen

 Premium Forvaltningsystemer AS		Office:	+(47) 224 37 598	
 Munkedamsveien 68			Mobile:	+(47) 928 90 254
 0270 Oslo
 Norway					mailto:oystein_at_premium.no
------------------------------------------------------------------
Received on Tue Apr 27 1999 - 21:30:45 CEST

Original text of this message