在做数据库的时候, 怎样统计成绩小于60分,60-70,70-80,80以上各个区间

如题所述

第1个回答  2010-09-30
select 行名 from 表名 where 成绩<60 OR (成绩>60 AND 成绩<70) OR(成绩>70 AND 成绩<80) OR 成绩>80

举例来说,我们若要在 Store_Information 表格中选出所有 Sales 高于 $1,000 或是 Sales 在 $500 及 $275 之间的资料的话,:
Store_Information 表格
store_name Sales Date
Los Angeles $1500 Jan-05-1999
San Diego $250 Jan-07-1999
San Francisco $300 Jan-08-1999
Boston $700 Jan-08-1999
我们就键入:
SELECT store_name
FROM Store_Information
WHERE Sales > 1000
OR (Sales < 500 AND Sales > 275)本回答被网友采纳
第2个回答  2010-09-30
你这个是查询数据么
第3个回答  2010-09-30
case when chengji<60 then ...
when chengji>=60 and chengji<70 then ...
...
第4个回答  2010-09-30
SQL select * from tablename where result < 60
相似回答