select jaringan, max(tingkat) jumlah
from (select connect_by_root idjar jaringan, level-1 tingkat
from my_table
start with konek_ke is null
connect by prior idjar = konek_ke
)
group by jaringan
order by jaringan
--
Regards,
Rudi Kristanto.
________________________________
From: musisi musisi <[email protected]>
To: Indo oracle <[email protected]>; OCS
<[email protected]>
Sent: Tuesday, September 15, 2009 9:26:34
Subject: [indo-oracle] Minta bantuan Query Level
Rekans,
saya minta tolong masalah query, saya punya table my_table dengan field dan
data sbb:
idjar || konek_ke
------------ --------- --
a1 ||
a2 ||
a3 ||
b1 || a1
b2 || a2
c1 || b1
d1 || c1
e1 || d1
saya sudah dapat menampilkan posisi tree sbb :
a1
---> b1
-------> c1
-----------> d1
------------ -> e1
a2
----> b2
a3
dengan query sbb:
select lpad ( ' ',4*(level+1) ) || idjar as idjar
from my_table
start with konek_ke is null
connect by prior idjar=konek_ ke
yang ingin saya tanyakan, query untuk menampilkan data sbb :
idjar || jumlah_jar
------------ --------- ---
a1 || 4
a2 || 1
a3 || 0
tolong pencerahannya.
Thx
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail. promotions. yahoo.com/ newdomains/ sg/
[Non-text portions of this message have been removed]
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
[Non-text portions of this message have been removed]