日期:2014-05-18 浏览次数:20466 次
SELECT A.* FROM (SELECT iCwid, stuff((SELECT ' ' + X.keyword FROM B表 AS X WHERE X.iCwid=Y.iCwid FOR xml path('')), 1, 1, '') AS keyword FROM B表 AS Y GROUP BY Y.iCwid) AS A INNER JOIN A表 AS B ON A.iCwid=B.iCwid