sqlserver中
字段内容做in条件用到方法:CHARINDEX(value,situation)
列变行显示用到:stuff
详情自行查找。
例子:
stuff((select ','+name from SYS_DICT where dictcode = 'SITUATION' and CHARINDEX(value,situation)>0 FOR xml path('')), 1, 1, '') as situationValue
本文共 276 字,大约阅读时间需要 1 分钟。
sqlserver中
字段内容做in条件用到方法:CHARINDEX(value,situation)
列变行显示用到:stuff
详情自行查找。
例子:
stuff((select ','+name from SYS_DICT where dictcode = 'SITUATION' and CHARINDEX(value,situation)>0 FOR xml path('')), 1, 1, '') as situationValue
转载于:https://www.cnblogs.com/flying607/p/4682665.html