Q: WHERE 1=1 AND 1=0 AND 1=1, how many rows returned?
Posted in 1996
Encountered a *great* bug today:
SELECT tabname FROM systables
WHERE 1=1 AND 1=0 AND 1=1
Q: What will the above query do?
A: return all the rows in systables!
and...
SELECT tabname FROM systables
WHERE 1=1 AND 1=0
Q: What about this one?
A: returns no rows.
This is SE 5.02.something on our Unisys SYSV box.
6.02 works OK, so I guess it's been fixed, but it sure is a weird one!
------------------------------------,------------------------------------------
Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ v2.4 Oct 95
Quanta Systems, Auckland | http://www.iiug.org/techinfo/faq/
New Zealand. Work: +64 9 377-4473 | ftp://ftp.iiug.org/pub/informix/faq
Home: +64 9 279-3571 | ftp://kcbbs.gen.nz:/ftp/pub/informix/