How do I select a row from one table where the value row does not exist in another table?
sql
Solution
You could also do something like this:
SELECT * FROM TableA
LEFT JOIN TableB on TableA.X = TableB.X
WHERE TableB.X IS NULL
(For the very straightforward example in your question, a `NOT EXISTS` / `NOT IN` approach is probably preferable, but is your real query is more complex, this is an option you might want to consider; if, for instace, you want som information from TableB where there is a match, but also want to know where there isn't one)
Problem
Let's say I have two identical tables, A and B, with the row "x". I want to select all elements in A, where the value of x in A is not in any value of x of B. How do I do that?