📜  mysql 将 null 转换为字符串 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:57.579000             🧑  作者: Mango

代码示例1
#If you really must output every values including the NULL ones
select IFNULL(prereq,"") from test

#OR, Coalesce will return the first non-null argument passed to it
#from left to right. If all arguemnts are null, it'll return null, but we're forcing an empty string there, so no null values will be returned.
SELECT COALESCE(prereq, '') FROM test