Table
P_ID I_ID S_ID T_ID Column Column1
-- (<Column1> supposed to be <Column>.<Table>-<Column>.<Table1>)
Table
P_ID I_ID S_ID T_ID Column
I ran this query on source table:
select <column> from
<TABLE>
where
i_id='<value>';
and i get the output as 9000
then i run this query on target to test id Column1 is getting correct values
select P_ID, I_ID, S_ID, T_ID,
sum(<column>)
from
<TABLE> F,<TABLE2> PO
where
F.P_ID = PO.P_ID
and F.I_ID=PO.I_ID
and F.FLAG='Y' --something that we need
and T_id>='2012001' --just for results for 2012
and F.I_id='<Value>'
group by F.P_ID, F.I_ID, F.S_ID, F.T_ID
order by 1;
Here i get Output as
P_ID I_ID S_ID T_ID sum(<column>)
<Value> <Value> <Value> <Value> 18000
Obviously there are multiple rows in
POfor each row inF.Also, change your query to the more modern (since 1996!) join syntax:
Edited:
If you just want to assert that there is a row in
PO(not caring about how many rows) useexists():