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
posted @ 2021-05-17 15:52  晴和琼林  阅读(113)  评论(0编辑  收藏  举报