What does it mean to say;
select col1,col2 from table1 join table2 on 1=1 where table2.status = '1'
What does it mean to say;
select col1,col2 from table1 join table2 on 1=1 where table2.status = '1'
Sometimes I see predicates like "1=1" in queries generated by a tool.
The pseudocode for the tool would be something like:
sql := sql || '1=1';
FOR i IN 1 .. predicates.COUNT LOOP
sql := sql || ' AND ' || predicates(i);
END LOOP
This way, it doesn't have to worry about omitting the "AND" for the first predicate.