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 -> Re: Recursive Reference in SQL Calc

Re: Recursive Reference in SQL Calc

From: damorgan <damorgan_at_exesolutions.com>
Date: Fri, 15 Mar 2002 15:46:10 GMT
Message-ID: <3C921745.D6B91DF3@exesolutions.com>


Set up each of your subamounts as an inline view. Then query that.

SELECT SUM(a + b - c)
FROM

   (SQL query) a,
   (SQL query) b,
   (SQL query) c;

Daniel Morgan

Ian Jones wrote:

> given the following table structure
>
> id,...,date_initiated, date_closed,...
>
> how would one do the following calculation for a date range, grouped
> by month/year for charting purposes:
>
> count pending this month =
> count pending last month +
> count initiated this month -
> count closed this month
>
> assuming the first month's count pending is:
>
> count initiated first month - count closed first month
>
> Thanks!!
> Ian
Received on Fri Mar 15 2002 - 09:46:10 CST

Original text of this message

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