
oracle查询语句条件判断怎么写
一个表中有数据idstatename10jack11li20zh查询语句要怎么写,能够判断条件,同一个id,当状态state有1时查询1的这条,state没有1时查询0这...
一个表中有数据
id state name
1 0 jack
1 1 li
2 0 zh
查询语句要怎么写,能够判断条件,同一个id,当状态state有1时查询1的这条,state没有1时查询0这条
查询结果如下
1 1 li
2 0 zh 展开
id state name
1 0 jack
1 1 li
2 0 zh
查询语句要怎么写,能够判断条件,同一个id,当状态state有1时查询1的这条,state没有1时查询0这条
查询结果如下
1 1 li
2 0 zh 展开
2个回答
2016-01-14 · 做真实的自己 用良心做教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
关注

展开全部
一个多条件判断的sql:
select
oper.opid,
oper.user_name,
oper.user_host,
case
when oper.oper_type = 1 then 'System Manager'
when oper.oper_type = 2 then 'USER Manager'
end case,
case
when oper.oper_object_type = 1 then 'User'
when oper.oper_object_type = 2 then 'Role'
when oper.oper_object_type = 3 then 'Broker'
when oper.oper_object_type = 4 then 'QM Manager'
when oper.oper_object_type = 5 then 'User Group'
when oper.oper_object_type = 6 then 'Msg Flow'
when oper.oper_object_type = 7 then 'Queue'
end case
from esb_log_user_oper oper;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询