select count1=(select count(*) from grade where 分数<60),
       count2=(select count(*) from grade where 分数>=60 and 分数<80),
       count3=(select count(*) from grade where 分数>=80)

解决方案 »

  1.   

    select 成绩 from Grade where 成绩<='60' and 成绩>'0'
      

  2.   

    select count1=‘成绩<60:’+(select count(*) from grade where 成绩<60),
           count2=‘成绩>=60 and 成绩<80:)’+(select count(*) from grade where 成绩>=60   and 成绩<80),
           count3=‘成绩>=80’+(select count(*) from grade where 成绩>=80)
      

  3.   

    是:
    select count1=(select count(*) from grade where 分数<60),
           count2=(select count(*) from grade where 分数>=60 and 分数<80),
           count3=(select count(*) from grade where 分数>=80)
      

  4.   

    好象是大学课本上的题目 ^_^select count1=(select count(*) from grade where 分数<60),
           count2=(select count(*) from grade where 分数>=60 and 分数<80),
           count3=(select count(*) from grade where 分数>=80)
      

  5.   

    select count1=(case when 分数<60  then 分数 else 0 end ),
           count2=(case when  分数>=60 and  分数<80 then 分数 else 0 end),
           count3=(case when 分数>=80 then 分数 else 0 end ) from grade