SQL Server 一些记录

SQL Server 实现 MySQL group_concat

注释:连表查询时,子表单字段结果拼接

select DISTINCT(o.id),o.*, 
CAST(stuff(( 
SELECT ',' + title FROM t_rm_sealapplycommondetail0 d WHERE d.pid = o.id FOR xml path('')
) , 1 , 1 , '') AS VARCHAR(255)) as titles 
from t_rm_sealapplycommon o  where 1=1 

自己留存,项目配置

https://s1.ax1x.com/2020/07/21/UI7xld.png
https://s1.ax1x.com/2020/07/21/UI7z6A.png
https://s1.ax1x.com/2020/07/21/UI7vSH.png
https://s1.ax1x.com/2020/07/21/UI7OYD.png
https://s1.ax1x.com/2020/07/21/UI7Xfe.png
https://s1.ax1x.com/2020/07/21/UIHSOI.png
https://s1.ax1x.com/2020/07/21/UIH9mt.png
https://s1.ax1x.com/2020/07/21/UIHC0P.png
https://s1.ax1x.com/2020/07/21/UIHPTf.png
https://s1.ax1x.com/2020/07/21/UIHFk8.png
https://s1.ax1x.com/2020/07/21/UIHktS.png
https://s1.ax1x.com/2020/07/21/UIHAfg.png
https://s1.ax1x.com/2020/07/21/UIHVpQ.png