需要查两个表之间的差集 首先,想到的是主键直接not in select mailbox_id from co_user where mailbox_id not in (select mailbox_id from core_mailbox); 好吧!这个是可以,但是数据多了的话,想到这个查询的逻辑有点受不住 于是再改为下面的这样: select cu.mailbox_id,cm.mailbox_id from co_user as cu left join core_mailbox as c…