zoukankan      html  css  js  c++  java
  • 查询出成绩不小于80的人的姓名

    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)

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

  • 相关阅读:
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    算法の序列
  • 原文地址:https://www.cnblogs.com/yimiyan/p/3958904.html
Copyright © 2011-2022 走看看