|
-
 Originally Posted by hujasodu
WITH
query1 as (
Select nvl(Sum (Brutto),0) as B1, nvl(Sum (Netto),0) as N1
FROM Table 1
where ORDER_DATE between '19.09.11' and '19.12.11'
),
query1 as (
Select nvl(Sum (Brutto),0) as B2, nvl(Sum (Netto),) as N2
FROM Table 1
where ORDER_DATE > trunc(add_months(sysdate,-3))
)
select B1,N1,B2,N2 from query1, query2;
suppose that in the result always is going to be an element in any result of any query (nvl) and only one row (not using a group by), using a full join is going to give you what you are looking for.
query1 as (
Select nvl(Sum (Brutto),0) as B1, nvl(Sum (Netto),0) as N1
FROM Table 1
where ORDER_DATE between '19.09.11' and '19.12.11'
),
query2 as ( -- <---- it was query2.
Select nvl(Sum (Brutto),0) as B2, nvl(Sum (Netto),) as N2
FROM Table 1
where ORDER_DATE > trunc(add_months(sysdate,-3))
)
select B1,N1,B2,N2 from query1, query2;
correction
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|