是这样的么 传值就查询 空值就相当于1=1 --字段COL1、2、3 参数a b c select * from T_TSG_REVIEWHIS where REVIEWER='DEPT_BMLD_BSTA' and col1=a and (col2=b or b is null) and (col3=c or c is null)
相当于 REVIEWER 这个参数是拼出来的
还是不大了解多个传值 要怎么取? 如果传值是 1 1,2 3,4 那就是相当于这个? 应该也不对吧?select * from T_TSG_REVIEWHIS where REVIEWER='1_1_3' union all select * from T_TSG_REVIEWHIS where REVIEWER='1_2_4';
--字段COL1、2、3 参数a b c
select *
from T_TSG_REVIEWHIS
where REVIEWER='DEPT_BMLD_BSTA' and col1=a and (col2=b or b is null) and (col3=c or c is null)
相当于 REVIEWER 这个参数是拼出来的
那就是相当于这个? 应该也不对吧?select * from T_TSG_REVIEWHIS where REVIEWER='1_1_3'
union all
select * from T_TSG_REVIEWHIS where REVIEWER='1_2_4';