Re:Best practices for writing SQL queries
by mactrey on Saturday April 10, 2021 @02:47PM
(#26763926)
I'm so attached to starting all my where clauses with a TRUE (1=1 since SQL Server doesn't have boolean literals) that I do this when I need some OR clauses:
So you can comment out lines starting with OR individually. Some people might hate it but it makes sense conceptually for me since almost every query I write takes a chain of ANDs in the where clause as a starting point.
[ Parent
| on HN ]
There are no comments on this comment yet.