MySql Query Replace NULL with Empty String in Select

后端 未结 11 1298
天命终不由人
天命终不由人 2021-02-01 11:36

How do you replace a NULL value in the select with an empty string? It doesnt look very professional to output \"NULL\" values.

This is very unusual and based on my synt

11条回答
  •  [愿得一人]
    2021-02-01 12:35

    select IFNULL(`prereq`,'') as ColumnName FROM test
    

    this query is selecting "prereq" values and if any one of the values are null it show an empty string as you like So, it shows all values but the NULL ones are showns in blank

提交回复
热议问题