您的位置:首页 > 数据库

数据库中 一对多的情况下 把多列数据拼凑放到另外一张表的字段中

2016-10-28 16:05 239 查看
update PKCRCNTCM0 set
lvelcode=(select mlbscode=(select mlbscode+'^' from PKTAILBSM0 where locatype='10' and mlbstype='50' and tlntcode=t1.tlntcode
for xml path(''))
),
lvelname=(select mlbsname=(select mlbsname+'^' from PKTAILBSM0 where locatype='10' and mlbstype='50' and tlntcode=t1.tlntcode
for xml path(''))
) from PKCRCNTCM0 t1 where tlntcode!=''
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐