handa_varun
May 27th, 2005, 09:18 AM
i have an query
There are four tables::
table_1 :: date,acct_ref,prod_ref,short_qty,long_qty
table_2:: acct_num,date,cus,Qty
table_3:: acct_ref,acct_num,acct_name
table_4:: prod_ref,cus
use table_3 to join between acct_num and acct_ref & table_4 to join cusip and prod_hub
table_1 has (-ve)qty in short_qty & (+ve)qty in long_qty whereas qty column in table2 has both (-ve) & (+ve) qty in one column only.
There can be either a (-ve)qty or (+)qty
Requirement:: To identify where the qty is different from table1 & table2 & for which all accounts
please suggest the sql query to do so
its urgent
Regards
Varun
There are four tables::
table_1 :: date,acct_ref,prod_ref,short_qty,long_qty
table_2:: acct_num,date,cus,Qty
table_3:: acct_ref,acct_num,acct_name
table_4:: prod_ref,cus
use table_3 to join between acct_num and acct_ref & table_4 to join cusip and prod_hub
table_1 has (-ve)qty in short_qty & (+ve)qty in long_qty whereas qty column in table2 has both (-ve) & (+ve) qty in one column only.
There can be either a (-ve)qty or (+)qty
Requirement:: To identify where the qty is different from table1 & table2 & for which all accounts
please suggest the sql query to do so
its urgent
Regards
Varun