gurps_cov wrote:
The queries look the same. Im not sure what the 1=1 is all about though.
The 1=1 is just an artifact of automatically generating the SQL code. It's an always true where sub-clause, so it changes the query in absolutely no way.
It just makes it easier to generate code piecemeal (otherwise the code generator would have to re-parse the entire generated SQL string every time a where sub-clause was added).
(In particular, if a dummy 1=1 predicate is always added, every additional sub-clause can be in the form "and( WHATEVER )", without having to know if the existing where clause already contains a predicate. Without the dummy "1=1" predicate, the code generator would have to scan the existing clause to see if it needs to prefix the additional sub-clause with an "and".)
Ignore it.