sql语句 case

case:

sql语句 case

SELECT stdname,
max( CASE WHEN stdsubject = '语文' THEN result ELSE 0 END) "语文",
max( CASE WHEN stdsubject = '数学' THEN result ELSE 0 END) "数学",
max( CASE WHEN stdsubject = '物理' THEN result ELSE 0 END) "物理" ,
max( CASE WHEN stdsubject = '化学' THEN result ELSE 0 END) "化学"
FROM std
GROUP BY stdname;

sql语句 case

上一篇:Oracle rac架构和原理


下一篇:10个超赞的jQuery图片滑块动画