日期:2014-05-17 浏览次数:20693 次
with tb as(select 'ID' as ids,'CODE' AS co,'' m1 from dual Union all select 'ID' as ids ,'' as co ,'NAME' m1 from dual) select ids , wm_concat(co) co, wm_concat(m1) m1 from tb group by ids
------解决方案--------------------
SELECT MAX(ids) as ids,max(co) as co,max(m1) as m1 FROM
(
select 'ID' as ids,'CODE' AS co,'' m1 from dual
Union all
SELECT 'ID' AS ids ,'' AS co ,'NAME' m1 FROM dual
);
------解决方案--------------------
With tb_data As
(Select 'ID' As ids, 'CODE' As co, '' m1
From dual
Union All
Select 'ID' As ids, '' As co, 'NAME' m1 From dual)
Select ids, Max(co) co, Max(m1) m1 From tb_data Group By ids;