本帖最后由 sw138123 于 2011-09-21 22:01:27 编辑

解决方案 »

  1.   

    class表       |     student表   
    id            |     ID
    name          |     name
    total score   |     c_id
    写一句SQL找出所有没有Student 的 SchoolClass
      

  2.   

    select * from class C where not exists(select 1 from student where c_id = C.id)
      

  3.   

    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)