mysql 查询存在A表中而不存在B表中的数据
有两张表,学生信息表infolist:
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。学生姓名表namelist:
现要查询出,存在infolist中,而不存在namelist中的学生,语句如下:
select * from infolist where (select count(1) as num from namelist where infolist.name = namelist.name) = 0;
查询结果如下:
age有些奇葩,不用在意。

更多精彩