tom,10,null,20 这是第一条记录 第二条记录是 tom,null,20,null; 2条记录要合并成 tom,10,20,20
select name, id, max(case a when '' then a else a end) a, max(case b when '' then b else b end) b, max(case c when '' then c else c end) c from tb group by name,id;
相关文章: