Topic: SQL*Plus and PL/SQL >> complex Sql
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Milkyway |
Posted: Jun 05, 2007 12:50:27 AM |
Total Post: 1
Joined: Jun, 2007
|
Please help me to understand what this sql is doing,.
SELECT *
FROM (WITH locationnode_map AS (SELECT l_oid
, TO_NUMBER(SUBSTR(scbp,1,INSTR(scbp,'.')-1)) p_parent_oid
FROM (SELECT pn.oid l_oid,LTRIM(SYS_CONNECT_BY_PATH(pn.oid,'.'),'.') ||'.' scbp
FROM locationnode pn
WHERE pn.locationlevel_oid = 552
START WITH pn.OID in (5000)
CONNECT BY PRIOR pn.OID = pn.parent_oid
)
ORDER BY 2
)
SELECT /*+ index (sl idx_timenode) */ sl.timenode_oid t_oid
, SUM(on_order_cost) result
, sl.product_oid p_oid
, location.p_parent_oid l_oid
FROM location l
, locationnode_map location
, slma sl
WHERE sl.timenode_oid in (37, 38)
AND sl.product_oid = 3000310
AND sl.location_oid = l.oid
AND location.l_oid = l.locationnode_oid
GROUP BY sl.product_oid
, location.p_parent_oid
, sl.timenode_oid
) |
|
|
Vish |
| Posted: Jul 28, 2008 01:59:41 PM | |
|
Total Post: 47
Joined: Jan, 2007
|
from where u get this query
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 843 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 268 |
| neeraj sharma | 252 |
| Ramesh Jois | 245 |
| Bishal Khetan | 207 |
|
|