Possible Duplicate:
Why would someone use WHERE 1=1 AND <conditions> in a SQL clause?
I am working on a code base that often has
where 1=1
Often, these queries are complex and difficult to read. So it's not always feasible to break down the query semantics purely for a refactor. My gut instinct is that this is always unecessary. Maybe there exists a requirement for a where clause similar to the requirement for a Group By clause when performing a SELECT
with an aggregrate function alongside some column to group.
Is there ever a need for this?