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
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