Why would someone use WHERE 1=1 in a SQL clause?

If the list of conditions is not known at compile time and is instead built at run time, you don't have to worry about whether you have one or more than one condition. You can generate them all like: and  and concatenate them all together.

it used as an implementation convenience. 

The SQL query engine will end up ignoring the "1=1" so it should have no performance impact.

你可能感兴趣的:(Why would someone use WHERE 1=1 in a SQL clause?)