I have a function with several IN params.
I need to build a complex select and use the params in the WHERE CLAUSE.
Is there any way I can add some conditioning like this:
if ($1 > 0) then
condition1 ='col1 = $1';
end if;
SELECT * from table1 WHERE || condition1 ;