SELECT B_BRIDGE."ID",B_BRIDGE.BRIDGENAME,V_BRIDGESTATE.STATE,
(case when (V_BRIDGESTATE.SCORE >= 90 and V_BRIDGESTATE.SCORE <= 100) then 'A'
when (V_BRIDGESTATE.SCORE >= 80 and V_BRIDGESTATE.SCORE <= 89) then 'B'
when (V_BRIDGESTATE.SCORE >= 66 and V_BRIDGESTATE.SCORE <= 79) then 'C'
when (V_BRIDGESTATE.SCORE >= 50 and V_BRIDGESTATE.SCORE <= 65) then 'D'
when (V_BRIDGESTATE.SCORE < 50) then 'E'
end) as SCORE ,
(case when (V_BRIDGESTATE.STATE = 'red') then '红色报警'
when (V_BRIDGESTATE.STATE = 'green') then '正常'
when (V_BRIDGESTATE.STATE = 'yellow') then '黄色报警'
end) as red
FROM V_BRIDGESTATE
Oracle case when 用法
最新推荐文章于 2024-06-18 16:54:00 发布