issue with selecting 1 or 0 in mysql db

Posted by jason on Stack Overflow See other posts from Stack Overflow or by jason
Published on 2010-03-17T06:24:33Z Indexed on 2010/03/17 6:31 UTC
Read the original article Hit count: 114

Filed under:
|

I am having trouble with the following SQL statement i have had this issue before but I cant remember how i fixed the problem, I am guessing the issue with this is that mysql sees 0 as null ? Note I didnt show the first part of the Select statement as its irrelevant my sql works, its showing rows with toffline that are = to 1 as well as 0...

FROM table1 AS tb1
LEFT JOIN table2 AS tb2 ON tb2.id = tb1.id2
LEFT JOIN table3 AS tb3 ON tb3.id = tb1.id3
AND tb1.toffline = 0

I have also tried AND NOT tb1.toffline = 1 also WHERE tb1.toffline = 0 all with the same result...

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql