Reputation: 31
The query checks the value of a parameter foo which is passed by a dropdown inside a program. If that paramater contains a certain value, an attribute should only contain null values. Can I manage that without pl/SQL?
select * from table t
where case when $foo$ = 'yes' then t.something is null end
Upvotes: 0
Views: 33
Reputation: 65408
Just use nvl
function :
select *
from mytable t
where nvl($foo$,'yes') = 'yes';
Upvotes: 0
Reputation: 27314
Do you mean this logic?
select something
from table t
where ($foo$ = 'yes' and t.something is null) or ($foo != 'yes')
Upvotes: 1