使用逗号分隔的字符串更新列

时间:2013-06-19 08:49:38

标签: sql sql-server oracle oracle11g oracle10g

我想用多个值更新表格中的单个列。

Update Table_cust
Set Cust_Value=('1','2','3')
where cust_id in ('ABC','XYZ')

当我运行这个时,我得到一个错误,说右括号丢失,现在这是因为它希望我一次更新一个值,我不能。

2 个答案:

答案 0 :(得分:1)

这是你想要的吗?

Update Table_cust
Set Cust_Value='1,2,3'
where cust_id in ('ABC','XYZ')

答案 1 :(得分:0)

这应该有效:

Update Table_cust
Set Cust_Value='1,2,3'
where cust_id in ('ABC','XYZ')
相关问题