SQL> column jual format a50;
SQL> select group_id,
2 ltrim(max(sys_connect_by_path(qty || ' '
|| kd_product,'+')),'+') jual
3 from
4 (
5 select group_id, kd_product, qty,
6 row_number() over (partition by group_id
order by kd_product) rid
7 from detail
8 )
9 start with rid = 1
10 connect by prior rid = rid-1 and prior group_id =
group_id
11 group by group_id;
GROUP_ID JUAL
----------
--------------------------------------------------
1 4 0001+5 0002
2 1 0005
3 2 0003+2 0004+9 0008
--- abe ashfi <[EMAIL PROTECTED]> wrote:
>
> Dear all,
> Tolong saya dunk..
>
> saya punya table detail, datanya
>
> group_id kd_product qty
> 1 0001 4
> 1 0002 5
> 2 0005 1
> 3 0003 2
> 3 0004 2
> 3 0008 9
>
> saya mau query dan hasilnya itu akan tampil secara
> horizontal.
>
> penjualan
> ---------------
> 4 0001 + 5 0002
> 1 0005
> 2 0003 + 2 0004 + 9 0008
>
> gimana ya ??
>
> tolong ya para master oracle indonesia.
>
>
> Bravo Oracle
>
>
>
>
____________________________________________________________________________________
> Need a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
>
Send instant messages to your online friends http://uk.messenger.yahoo.com