Possible duplicate:
Why does someone use WHERE 1 = 1 AND <conditions> in an SQL statement?
I am working on a code base that often has
where 1=1
Often these queries are complex and difficult to read. Therefore, it is not always possible to break the semantics of a query solely into refactoring. My gut instinct is that it is always necessary. There may be a requirement for the where clause, similar to the requirement for the Group By SELECT when executing a SELECT with an aggregation function next to some column for grouping.
Is there a need for this?
sql
P.Brian.Mackey
source share