Hi,
I have table1
col1 Parent_party_name
col2 forecasted_amt_acd
col3, col4...
Table2
col1 Parent_name
col2 cancelled amount
col2, col3..
I want to write a query which picks up the following
1. abc on col1 from table1
2. sum(col2) from table1 for abc
3. search for abc in col1 of table2
4. if it is there then sum(col2) for abc from table2
I have tried this query
select a.PARENT_PARTY_NAME, sum(a.FORECAST_AMOUNT_TO_CANCEL_ACD) as "At-Risk",
sum(b.PROD_VALUE_CAN_ACD) as "Cancelled"
from RIMINI_AT_RISK_MAIN_V2 a,
RIMINI_CANCELLATION b
where a.PARENT_PARTY_NAME = b.PARENT_NAME
group by a.PARENT_PARTY_NAME, b.PARENT_NAME
but doesn't give me the expected result.