我在mySQL表中拥有大量的空值,并且需要永久地逐列删除它们。是否有快捷方式用“N / A”文本替换所有Null值。
Column1 Column2 Column3 Column4
row 1 David **Null** 15th Dec $5666
row 2 **Null** Director 10th JAN $9500
row 3 John Janator **Null** $1000
row 4 Steve Market 6th FEB **Null**
答案 0 :(得分:3)
也许这样:
update tab
set Column1 = coalesce(Column1,'N/A'),
Column2 = coalesce(Column2,'N/A'),
Column3 = coalesce(Column3,'N/A'),
Column4 = coalesce(Column4,'N/A')