SQL:查询A表内的多个字段,并把这几个字段查询结果数据合并更新到B表的一个字段数据里,存储过程如何写?

-U仅是2个字段(名称,信息摘要),并且名称名称和更新的表与Bbergeinto Table bb-use表AA-B连接。
= A。
城市||

sql语句如何将select出的多个结果insert到一个字段中

tablegoods(goodsid,shortname)declare@shortnamevarchar(50)declare@namevarchar(255)------结果set@name=''------初始化,非常重要declarecursor1cursorfor--定义Cursorcursor1selecttop3shortnamefromgoods-假设 - 使用光标的对象(必要时输入 select 文本),即你提到的选择结果集 opencursor1 -- 打开光标 fetchnextfromcursor1into@shortname -- 光标下移一行,将检索到的数据放入之前定义的变量中@short in name while@@fetch_status=0 -- 判断数据是否成功检索 begin@name=@name+@shortname -- 执行相应的操作(必要时输入SQL文本)。
根据您的需要覆盖这里。
fetchnextfromcursor1into@shortname -- 将游标向下移动一行 endclosecursor1 -- 关闭游标 deallocatecursor1 最后,@shortname 就是您需要获取的结果,允许您在表中插入或更新字段。

一个字段里有多个数据如何用sql语句

只需在组内使用毗邻并计算即可。
这代表基于价值字段的聚合