惰怠 2022-04-17 12:41 采纳率: 71.4%
浏览 602
已结题

Mysql 不用外连接 用内连接 如何查询某些没有选课学生的信息

img

img

只想到用外连接 然后用判断null 来确定哪些 学生没有选课,想了解 不用外连接要怎么做 这个

  • 写回答

2条回答 默认 最新

  • xtasce2012 2022-04-17 16:59
    关注

    --查询没有选课的学生
    --方法一:
    select t.sno,t.sname from student t where not exists
    (select 1 from score t1 where t.sno=t1.sno);

    --方法二:
    select t.sno,t.sname from student t where t.sno not in
    (select t1.sno from score t1 );

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月26日
  • 已采纳回答 4月18日
  • 创建了问题 4月17日