日期:2014-05-17 浏览次数:20854 次
WITH t AS ( SELECT 'A' name,'11' age,'11' no,'ABC' remark FROM dual UNION ALL SELECT 'A' name,'11' age,'11' no,'CCC' remark FROM dual UNION ALL SELECT 'A' name,'11' age,'11' no,'AAA' remark FROM dual UNION ALL SELECT 'B' name,'11' age,'11' no,'CCC' remark FROM dual UNION ALL SELECT 'B' name,'11' age,'11' no,'DDD' remark FROM dual UNION ALL SELECT 'B' name,'11' age,'11' no,NULL remark FROM dual UNION ALL SELECT 'B' name,'11' age,'11' no,NULL remark FROM dual ) SELECT name,age,no,wm_concat(remark) FROM t GROUP BY name,age,no;