基于@Mosty Mostacho 给出的答案,下面介绍如何在 MySQL 中进行类似的操作,以确定哪些条目不存在于表中,哪些条目不存在于任何其他数据库中。
select col1 from (
select 'value1' as col1 union
select 'value2' as col1 union
select 'value3' as col1
) as subquery
left join mytable as mytable.mycol = col1
where mytable.mycol is null
order by col1