Optional WHERE clause in Reports
Posted: Tue Apr 16, 2024 8:18 pm
Is there a way to set a where clause with variable to be optional?
with a sql query like:
select * from my_table
where id = {v_var}
I would like to ignore completely the where clause if my input was null.
if my input is 123, my sql clause would be:
select * from my_table
where id = 123
and if my input is null, my sql clause would be:
select * from my_table
Is there a way to make something like this?
with a sql query like:
select * from my_table
where id = {v_var}
I would like to ignore completely the where clause if my input was null.
if my input is 123, my sql clause would be:
select * from my_table
where id = 123
and if my input is null, my sql clause would be:
select * from my_table
Is there a way to make something like this?