update my_table set a = ?,b = ?,c = ?,d = ?,where customer = ?
但是,如果数据库中没有值,我只想更新一个新值的属性.我怎样才能做到这一点?
update my_table set a = COALESCE(a,?),b = COALESCE(b,c = COALESCE(c,d = COALESCE(d,?) where customer = ?
COALESCE()从其参数中返回第一个非空值.