so I’m trying to figure out a way to compare each and every row of a column against all the rows in another column and filter out those that doesn’t exist in the column that it is comparing to. I understand how to compare the two columns on a row-by-row basic like this:
select table1.column1
from table1 inner join
table2 on table1.id = table2.id
where column1 <> column2
But I want to compare the rows from table1 in column1 against ALL the rows of column2 in table2 and find rows in column1 that doesn’t exist in column2 at all. So it would be something like columns with these values:
Column1 Column2
1 2
2 1
4 3
5 5
7 6
And after the SQL it would become something like this:
Column1
4
7
Try with NOT IN: