SQL语句 - MS-SQL Server / 基础类
将学生选课成绩从百分制改为等级制(即A、B、C、D、E五级)。
使用存储过程
SQL code:
select case
when score >=0 and score<20 then 'E'
when score >=20 and score<40 then 'D'
when score >=40 and score<60 then 'C'
when score >=60 and score<80 then 'B'
else 'A'
select case
when (score-20)/20=0 then 'e'
when (score-20)/20=1 then 'd'
when (score-20)/20=2 then 'c'
when (score-20)/20=3 then 'b'
when (score-20)/20=4 then 'a' end
from tb
SQL code:
select
case
when score score>80 then 'A'
when score score<60 then 'B'
when score score<40 then 'C'
when score score<20 then 'D'
else 'E'
end
from tb
SQL code:
select
case
when score score>=80 then 'A'
when score score>=60 then 'B'
when score score>=40 then 'C'
when score score>=20 then 'D'
else 'E'
end
from tb
楼上手误,修正
SQL code:
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......