Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用这样的东西:
select @x=coalesce(@x,'')+col1 from testdatatable
这在 SQL Server 2008 上完美运行,但对于 IQ 却失败了:
SELECT 返回多于一行
我们需要更多关于您的目标的信息。
您的选择语句是否返回多行?如果是这样,IQ 会尝试设置单个(varchar?)变量@x,具有许多值……这是不可能的。看起来合并对我来说不是你的问题。
如果您尝试从 testdatatable 中取回单行,并将该单行的 col1 与 @x 连接,为什么不
select @x = isnull(@x, '') + col1 from testdatatable where (clause to get single row)