select djid, pxId,
JgmData = (substring((select ',' + JgmData
from D_Gsp_HqJgm where DjId = a.DjId and PxId = a.PxId
for xml path('')),2,9999))
from (select distinct djId,pxId from D_Gsp_HqJgm ) a

 

 

for xml path:它就是将查询结果集以XML形式展现,有了它我们可以简化我们的查询语句实现一些以前可能需要借助函数活存储过程来完成的工作。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2021-07-02
  • 2021-08-17
  • 2021-12-09
  • 2021-12-05
猜你喜欢
  • 2022-03-07
  • 2021-11-28
  • 2021-08-20
  • 2022-12-23
  • 2021-12-27
  • 2021-08-23
相关资源
相似解决方案