MySQL select where column is not empty

后端 未结 13 2151
深忆病人
深忆病人 2020-11-30 18:18

In MySQL, can I select columns only where something exists?

For example, I have the following query:

select phone, phone2
from jewishyellow.users
wh         


        
13条回答
  •  青春惊慌失措
    2020-11-30 18:54

    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

提交回复
热议问题