MySQL IFNULL “N/A” yields “item cannot be found in the collection” Error

后端 未结 1 1219
盖世英雄少女心
盖世英雄少女心 2021-01-21 04:29

I have been using IFNULL functions to convert NULL values to zeros in my SQL queries, like this:

SELECT IFNULL(mem.comment_count,0) FROM members...
相关标签:
1条回答
  • 2021-01-21 05:00

    Your query is good, but your code is probably looking for a column name? Try an alias:

    SELECT IFNULL(mem.address2,'N/A') AS address2 FROM members mem ...
    
    0 讨论(0)
提交回复
热议问题