class表 | student表 id | ID name | name total score | c_id 写一句SQL找出所有没有Student 的 SchoolClass
select * from class C where not exists(select 1 from student where c_id = C.id)
select c.* from class c where name not in (select name from student) select c.* from class c where not exists (select 1 from student s where s.id = c.id and s.name = c.id)
id | ID
name | name
total score | c_id
写一句SQL找出所有没有Student 的 SchoolClass
select c.* from class c where not exists (select 1 from student s where s.id = c.id and s.name = c.id)