MySQL select rows and ignore row if column is blank

后端 未结 2 1774
面向向阳花
面向向阳花 2021-01-20 17:19

Using Dreamweaver CS5 / MySQL

I\'m trying to set up a query that will display rows of data but only if a specific column has data in it. If the Charname column is bl

2条回答
  •  一整个雨季
    2021-01-20 17:50

    You could use COALESCE() to treat blank (empty string) and NULL as the same thing:

    SELECT * FROM users WHERE COALESCE(Charname, '') != ''
    

    You never told us what "empty" actually means, but a good guess would be empty string or NULL.

提交回复
热议问题