利用help_topic表把字符串转换成行(分隔符号',') ),) as `id` FROM mysql.`help_topic`; 统计字符串每个子串出现次数(分隔符号',') ),) AS `sub_column`,COUNT(A.`column`) AS `count` FROM `test` A ) ),);…
DECLARE @xml XML SET @xml=CAST(REPLACE('<ROOT><X>'+'AA,AB,AC,AD'+'</X></ROOT>',',','</X><X>') AS XML) SELECT T.C.value('.','varchar(20)') AS Result FROM @xml.nodes('/ROOT/X') T(C) 取前几条记录,如'10,102,10254,103265,541,2154,4…