Why would someone use WHERE 1=1 AND
in a SQL clause (Either SQL obtained through concatenated strings, either view definition)
I\'ve
While I can see that 1=1 would be useful for generated SQL, a technique I use in PHP is to create an array of clauses and then do
implode (" AND ", $clauses);
thus avoiding the problem of having a leading or trailing AND. Obviously this is only useful if you know that you are going to have at least one clause!