最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

sql條件查詢語(yǔ)句的簡(jiǎn)單實(shí)例

 更新時(shí)間:2013年10月17日 15:32:06   作者:  
這篇文章介紹了sql條件查詢語(yǔ)句的簡(jiǎn)單實(shí)例,有需要的朋友可以參考一下
復(fù)制代碼 代碼如下:

//創(chuàng)建成績(jī)表
create table result(
       stu_id varchar2(20) not null,
       china number(9,2) null,
       math number(9,2) null,
       english number(9,2) null
);

//插入數(shù)據(jù)
insert into result values('0001',60,20,80);
insert into result values('0002',80,60,80);
insert into result values('0003',20,85,80);
select *from result;

//條件查詢
select  stu_id,(case
         when china>80 then '優(yōu)秀'
         when china>=60 then '及格'
         when china<60 then  '不及格'
         end) as 語(yǔ)文 ,
      (case
         when math>80 then '優(yōu)秀'
         when math>=60 then '及格'
         when math<60 then '不及格'
       end )as 數(shù)學(xué) ,
         (case
         when english>80 then '優(yōu)秀'
         when english>=60 then '及格'
         when english<60 then '不及格'
       end) as 英語(yǔ)
from result               

相關(guān)文章

最新評(píng)論

鹿泉市| 长沙县| 阳曲县| 安龙县| 门头沟区| 曲麻莱县| 甘泉县| 迁安市| 错那县| 南乐县| 兴隆县| 大城县| 铜川市| 舟山市| 台中市| 霍山县| 涞水县| 柳江县| 牡丹江市| 武乡县| 隆回县| 卓尼县| 鸡西市| 织金县| 白玉县| 阳原县| 伊金霍洛旗| 徐闻县| 株洲市| 英山县| 许昌市| 谷城县| 长沙市| 梁平县| 周宁县| 磴口县| 榆中县| 沁阳市| 清徐县| 隆昌县| 新巴尔虎右旗|