日期:2014-05-18  浏览次数:20558 次

多行合并为一行
表A
id f1 f2
123 aa null
123 null bb
234 null cc
234 aa

合并为

id f1 f2
123 aa bb
234 aa cc

------解决方案--------------------
SQL code
select id,max(f1) as f1,max(f2) as f2 from A group by id