ORACLE WHERE 条件里面如何实现分支。
今天在工作的个过程中需要实现一个在sql的where条件里面实现分子的问题,最终的解决方案如下。
select *
from rpdape2013 a
where ('Z01070000000000009' = '<!GSHSDW!>' AND A.DAPE_DATAID IN (select X.BIXNDWTOBZDW_DAPEBH from BIXNDWTOBZDW X))
OR ('Z01070000000000009'<> '<!GSHSDW!>' AND A.DAPE_DWBH IN (SELECT LSBZDW_DWBH FROM LSBZDW WHERE LSBZDW_DWBH = '<!GSHSDW!>' OR LSBZDW_SJGS = '<!GSHSDW!>'))