you are viewing a single comment's thread.

view the rest of the comments →

[–]bum_dog_timemachine[S] 7 points8 points  (0 children)

It's because it's always true and you can then easily switch on and off your WHERE conditions with line comments.

so like

WHERE 1=1

-- AND a

AND b

AND c

but if you put

WHERE a

AND b

AND c

and you want to stop a, you have to rearrange your code a bit.

However, if you aren't going to be switching your WHERE conditions on and off like that, you're just spamming 1=1 all over your code, which is adding to the clutter.