📜  如果 null 不更新 - SQL 代码示例

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

代码示例1
UPDATE some_table SET
  column_1 = COALESCE(param_1, column_1),
  column_2 = COALESCE(param_2, column_2),
  column_3 = COALESCE(param_3, column_3),
  column_4 = COALESCE(param_4, column_4),
  column_5 = COALESCE(param_5, column_5)
WHERE id = some_id;