select (case ld.recycletype when '0' then '\u6708' when '1' then '\u65E5' when '2' then '\u65F6' else '\u5206' end) from 表
显示![]()
博客展示了一段SQL代码,使用CASE语句根据表中ld.recycletype字段的值进行条件判断,当值为'0'时显示'月',为'1'时显示'日',为'2'时显示'时',其他情况显示'分'。
select (case ld.recycletype when '0' then '\u6708' when '1' then '\u65E5' when '2' then '\u65F6' else '\u5206' end) from 表
显示![]()
2667

被折叠的 条评论
为什么被折叠?