积分表result中有A B C D四列,要求:1)当A列值大于等于B列时,选择A列否则选择B列 2)当C列值大于等于D列时,选择C列否则选择D列
用SQL语句实现正确的是:( )
A. select ( when A>=B then A else B ) MAX_AB,( when C>=D then C else D ) MAX_CD from result;
B. select (case when A>=B then A else B ) MAX_AB,(case when C>=D then C else D ) MAX_CD from result;
C. select (case when A>=B then A else B end) MAX_AB,(case when C>=D then C else D end) MAX_CD from result;
D. select (case A>=B then A else B end) MAX_AB,(case C>=D then C else D end) MAX_CD from result;
参考答案: C
解析:逻辑表达式的法语:case when … then … else … end