现在有两条数据显示如下:          a        b        c                  d                    e
1 12QW 402 21 荣威750 201,电池箱子,3
2 12QW 402 21 荣威750 181,电池规格,3需求是这样显示:12QW 402 21 荣威750 201,电池箱子,3;181,电池规格,3
b=402
这个应该怎么写呢?

解决方案 »

  1.   

    select a,b,c,d,
    replace(replace(replace(wm_concat(e||';'),';,','%'),';',''),'%',';')
    from tb group by a,b,c,d
      

  2.   


    --楼主到底是几列呀!!!迷糊中...
    select a,b,c,wm_concat(d) d from tb
    group by a,b,c;
    --初学者,错了勿喷哈! try 
      

  3.   

    select b,c,d,e,
    replace(replace(replace(wm_concat(f||';'),';,','%'),';',''),'%',';')
    from ( 
    select '12QW' b, 402 c, 21 d, '荣威750' e, '201 电池箱子,3' f from dual
    union
    select '12QW', 402, 21, '荣威750', '181 电池规格,3' from dual
    ) group by b,c,d,e--结果
    1 12QW 402 21 荣威750 181 电池规格,3;201 电池箱子,3
      

  4.   

    select a,b,c,d,replace(wm_concat(e),',',';') from tb group by a,b,c,d;