使用时
LEFT JOIN,必须将对子表的限制放入
ON子句中。否则,当您测试这些字段时,您将仅匹配非NULL行,这与
ANDmail_log.list_id IS NULL测试矛盾。
SELECt mail_list.*FROM mail_listLEFT JOIN mail_log ON mail_log.list_id = mail_list.list_id AND mail_log.send_date = '2016-07-12' AND mail_log.location_id = '2'WHERe mail_log.list_id IS NULL
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)