Gid*_*eon 1 sql
我想用同一行另一列中的值替换所有具有 NULL 值的值。
我尝试了不同的 sql 语句,但没有成功。
问候
Gur*_*ngh 6
如果要更新,请执行以下操作:
update t set col1 = col2 where col1 is null
如果您只想进行选择,请使用大多数数据库支持coalesce:
coalesce
select coalesce(col1, col2) from t;
归档时间:
8 年,9 月 前
查看次数:
5686 次
最近记录: