3 ms·
You can use a CASE-statement for each possible filter and apply it only if the filter value(s) are non-trivial. -- Parameter :filter -- AND CASE WH
by mborch 11y ago
You can use a CASE-statement for each possible filter and apply it only if the filter value(s) are non-trivial.
-- Parameter :filter
--
AND CASE WHEN :filter IS NOT NULL THEN
table.column = :filter
ELSE TRUE END
This has zero cost in the case where :filter is unset.
- barrkel 11y agoThe filters are predicates, not values.