sql-server 2008 r2 连接两个字符串

文卡特

update qtable set Section = Section + ',Teaching' where qid=522

此更新语句不会连接/附加值。

  Section contains null value initially. 
约格什·夏尔马

concat()如果您使用的是 SQL Server 2012,请使用:

update qtable 
set Section = concat(Section, ',Teaching') 
where qid=522;

对于旧版本,您可以使用

update qtable 
set Section = coalesce(Section, '') + ',Teaching'
where qid=522;

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章