update soft_count set soft_id=(select soft_id from old_soft where classid=5) where soft_id=10select soft_id from old_soft where classid=5 这个查询,返回是一个记录集,不是一条记录我的目的是希望这样的结果
update soft_count set soft_id=(2,3,4,5) where soft_id=10
执行上面的语句报错。提示如下
子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。谢谢大家告诉我怎么解决
update soft_count set soft_id=(2,3,4,5) where soft_id=10
执行上面的语句报错。提示如下
子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。谢谢大家告诉我怎么解决
不知道你想做什么.
http://topic.csdn.net/u/20080612/22/c850499f-bce3-4877-82d5-af2357857872.html
declare @s nvarchar(1000)
select @s=isnull(@s+',','')+rtrim(soft_id) from old_soft where classid=5
update soft_count
set soft_id=@s where soft_id=10
soft_id=(2,3,4,5)
这个结果是 select soft_id from old_soft where classid=5 查询出来的结果。一个记录集。