MySQL select where column is not empty

后端 未结 13 2124
深忆病人
深忆病人 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

    In my case I had a varchar column, both the methods of IS NOT NULL & != '' didn't work, but the following worked for me. Just putting this out here.

    SELECT * FROM `db_name` WHERE `column_name` LIKE '%*%'
    
    0 讨论(0)
提交回复
热议问题