PL/SQL - Optional conditions in where-clause - without dynamic sql?

后端 未结 5 1822
隐瞒了意图╮
隐瞒了意图╮ 2021-02-08 13:51

I have a query where not all conditions are necessary. Here\'s an example of what it looks like when all conditions are used:

select num
from (select distinct q.         


        
5条回答
  •  感情败类
    2021-02-08 14:11

    where ( columnA = passedValue or passedValue = -1 )

    when passed value into sql is -1, columnA can be anything..

提交回复
热议问题