sql表结构如下

username  corse  score

   1   math   87
   1   english  70
   2   math   72
   2   chinese  90
   3   math   90
   3    english  98
   3    chinese  89

解决思路:

1)查询出成绩小于80的人的姓名:SELECT username from  scoretable WHERE score <80

2)之后查询表中名字不在上述结果中的人

SELECT distinct username from  scoretable WHERE username NOT  in (SELECT username from  scoretable WHERE score <80)

 

--有的时候生活不必追究于结果,换个思路,真的海阔天空。

 

相关文章:

  • 2022-01-14
  • 2022-12-23
  • 2021-11-14
  • 2021-07-24
  • 2022-12-23
  • 2021-08-03
  • 2021-06-07
  • 2021-08-13
猜你喜欢
  • 2021-07-21
  • 2021-10-20
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案