MySQL select where column is not empty
Solution 1:
Compare value of phone2
with empty string:
select phone, phone2
from jewishyellow.users
where phone like '813%' and phone2<>''
Note that NULL
value is interpreted as false
.
Solution 2:
To check if field is NULL use IS NULL
, IS NOT NULL
operators.
MySql reference http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html