|
-
Change The Level Number In An Sql Query
Hi
I've this query:
SELECT LEVEL,LPAD(' ',(LEVEL+1)*5,' ')||ENAME ENAME
FROM EMP
START WITH MGR IS NULL
CONNECT BY PRIOR EMPNO = MGR
the result is:
LEVEL ENAME
1 KING
2 JONES
3 SCOTT
2 FORD
3 SMITH
my question is that if i except FORD how can i change the level number to SMITH from 3 to 2.
for example:
SELECT LEVEL,LPAD(' ',(LEVEL+1)*5,' ')||ENAME ENAME
FROM EMP
WHERE ENAME <> 'FORD'
START WITH MGR IS NULL
CONNECT BY PRIOR EMPNO= MGR
the result is:
LEVEL ENAME
1 KING
2 JONES
3 SCOTT
2 SMITH
regards
nadia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|