when s_mark <= 80 and s_mark >= 60 then '优秀'
when s_mark <= 59 and s_mark >= 40 then '良好'
when s_mark <>= 20 then '一般'
when s_mark <= 19 and s_mark > 0 then '较差' from student_scores
----------------------------------------
2. case和decode (P61)语句有什么区别?分别在什么场合使用?
SELECT CASE SIGN(5 - 5) WHEN 1 THEN 'Is Positive' WHEN -1 THEN 'Is Negative' ELSE 'Is Zero' END FROM DUAL;
select decode (条件,结果1,输出1,结果2,输出2)
SELECT DECODE(SIGN(5-9), 1, 'Is Positive', -1, 'Is Negative', 'Is Zero')FROM DUAL
--------------------------------------
No comments:
Post a Comment