4 ms·
Conditional concat should be pretty rare. When are you doing that?
by hot_gril 2y ago
Conditional concat should be pretty rare. When are you doing that?
- DangitBobby 2y agoWhen I need a new where clause or a new order by, or I have to stop using an IN filter because you can't use an empty tuple. Stuff like that.
- hot_gril 2y agoYeah, if you're going to conditionally add filters, this is mostly the only way with SQL. There are a few tricks depending on the dialect, like =ANY() is more convenient than IN, or COALESCE can avoid some dynamic WHEREs. You're not really missing anything other than query builders, which are worse for other reasons.