今天刚刚知道,原来SQL还可以这么写,赶紧记一下。o(∩_∩)o...哈哈,这下复杂查询的问题可以解决了。
select case when u.user_code='admin' then '1100'
when u.user_type=3155 then '3155'
when u.user_type=3156 then '3156'
when u.user_type=3157 then '3157' end,
u.*
from sysmanage.tb_user_kbmp u
where
(case when
u.user_code='admin' then 1100
else u.user_type end) =1100