I want to check if the OrderID = 2 exist in Table1 and does not exist in Table2 then return 1 or true.
If OrderID = 2 exist in both table then return 0 or false..
How can that be done in SQL query?
Table1
=======
ID | OrderID
1 2
2 2
Table2
======
OrderID | Name
1 A
2 B
Something like that?