Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table to load. The condition to load this table is the particular column's value is not available in previously loaded tables. For example:
Two previously loaded tables:
AR_Table:
ID | Vendor_Trans_ID | AR_Amt |
---|---|---|
1 | V001 | 100 |
2 | V002 | 200 |
3 | V003 | 300 |
4 | V004 | 400 |
AP_Table:
ID | Invoice_Id | AP_Amt |
---|---|---|
1 | AP001 | 500 |
2 | AP002 | 600 |
3 | AP003 | 700 |
4 | AP004 | 800 |
Now I want to load a final table in which I have Vendor_Trans_Id and Invoice_Id. Condition to load records in this final table is Final_table.Vendor_Trans_Id<> AR_Table.Vendor_Trans_Id and its Final_Table.Invoice_Id<>AP_Table.Invoice_Id
Thanks!
Use Not(Exists) function
Ok.. I used Exists
But I see some strange result. That is, if my "final" table has duplicate rows, by Invoice_id and if this Invoice_id not present in AP_Table....the result I get is only one row and not the duplicate rows in the final table.
As per my requirement I should get both the rows if Invoice_Id is not present in AP_Table.