两种条件过滤合并到一个话语

两种条件过滤合并到一个语句select a from tab where num 0select b from tab where num 0合并到一个

两种条件过滤合并到一个语句


select a from tab where num = 0


select b from tab where num <> 0

合并到一个语句
[解决办法]


select case when num = 0
                 then a
            when num <> 0
                 then b
       end as C
from tab

[解决办法]
select a, b from tab where ( num = 0 or num <> 0 )
[解决办法]
搞错了。。。。。