Have to write a query like:select *
from
where
table1.column1 not in (select column 2 from table 2 where column22 <>'123')