|
|
|
|
|
by mactrey
1902 days ago
|
|
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: SELECT foo
FROM bar
WHERE 1=1
AND (1<>1
OR baz > boom
OR fizz >= bang
)
AND foo is not null
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. |
|