有人可以告诉我如何附加SQL吗?我整天都在努力解决这个问题。这是我到目前为止所拥有的:
update table1
set field1 = field1 + '123456'
where field2 = '12'
抱歉,我忘记提及我要更新语句中的多个字段。
最佳答案
只要field1不为null或要追加的数据不为null,您的语句就应该起作用。
在field1为null的情况下,这样的操作可能会有所帮助。
update table1 set field1 = ISNULL(field1, '') + '123456' where field2 = '12'