Try to search your question here, if you can't find : Ask Any Question Now ?

Composite key in NOT IN clause

HomeCategory: stackoverflowComposite key in NOT IN clause
Avatargaurav asked 1 month ago

I have a table where two columns (Invoice_Id & Invoice_line) as the primary key (Composite key). And there is another table with similar structure. I want to filter out the data from table 1 which is not in the table two.

Something similar to below query

   FROM INVOICE_LINE T1
   WHERE T1.INVOICE_ID AND T1.LINE
   NOT IN (SELECT T2.INVOICE_ID,T2.LINE
           FROM INVOICE_LINE2
           WHERE T1.INVOICE_ID = T2.INVOICE_ID
           AND   T1.LINE       = T2.LINE
);

I have tried the above query but its not working properly.

1 Answers
Best Answer
AvatarArben answered 1 month ago
Your Answer

16 + 9 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com