首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SQL2008有关问题

2013-01-09 
求助SQL2008问题【Score显示问题】本来我库里存的是这种数据然后,我想让【Score】显示成这样特来求助万能的CSD

求助SQL2008问题
【Score显示问题】

本来我库里存的是这种数据
SQL2008有关问题


然后,我想让【Score】显示成这样
SQL2008有关问题


特来求助万能的CSDN!!!在线等哦!
[解决办法]
case when  scores 在什么区间 then 优
case when  scores 在什么区间 then 良  
case when  scores 在什么区间 then 及  
[解决办法]
 select F_classname,f_coursename,f_studentid,f_name,case when scores=10000 then '优'  when scores=9999 then '良' else '及' end scores ,inputdate
 from score
[解决办法]

select F_ClassName,F_CourseName,F_Studentid,F_Name,
Scores=case when Scores>=10000 then '优'
       case when Scores>=8000 and Scores<=9999 then '良'
       case when Scores>=6000 and Scores<=7999 then '及' end from 表

[解决办法]
Select 
        F_ClassName
        ,F_CourseName
        ,F_StudentId
        ,F_Name
        ,Case when Scores>=10000 Then N'优' 
              when Scores>=9000 Then N'良'
              when Scores>=8000 Then N'中'
              when Scores>=6000 Then N'及'
              Else N'不及'
          End As Scores
        ,InputDate
    From tb_Result

热点排行