You are better off using merge and null options individually
consider that this table1 identifier connects to table 2 identifier, and where clause can use p1 parameter for col1 or p2 for col2, etc.
select * from table1 t1 inner join table2 t2 on t2.id = t1.id
If p1 is null, you get the test t2.col1 = t2.col1, which effectively rejects p1 from the where clause.
Preet sangha
source share