Oracle函数之decode()

语法:

decode(expression,value,result1,result2)

如果expression=value,则输出result1,否则输出result2

示例:

select USER_NAME userName,max(EXAM_SCORE) examScore from EXAM_USER WHERE ((decode(?1,‘‘,1, 0) = 1) or DEPT_NAME = ?1) and QUESTION_TYPE is not null and EXAM_SCORE is not null GROUP BY USER_NAME

Oracle函数之decode()

上一篇:MySQL 综合查询部分习题


下一篇:linux 安装mysql