mysql 查询存在A表中而不存在B表中的数据

有两张表,学生信息表infolist:code

学生姓名表namelist:blog

现要查询出,存在infolist中,而不存在namelist中的学生,语句以下:class

select * from infolist where (select count(1) as num from namelist where infolist.name = namelist.name) = 0;

查询结果以下:select

age有些奇葩,不用在乎。im

相关文章
相关标签/搜索