Home » SQL & PL/SQL » SQL & PL/SQL » row level
row level [message #259729] Thu, 16 August 2007 06:12 Go to next message
nadia74
Messages: 85
Registered: August 2007
Member
hi
I've a porblem. I want to change the level number of the rows in a hierarchical query when except some rows from the query. for example:
level empname
1 scott
2 alan
3 king

TO:
level empname
1 scott
2 king
and this happened when i except alan from the query
Re: row level [message #259733 is a reply to message #259729] Thu, 16 August 2007 06:35 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
I am also having porblem in undersatnding whta yuo aer sayning . Sad

Is it so difficult to read the first two topics in this forum before you post it. I am really sorry i cannot understand anything whatever you are trying to say. Please please please before you post it read it twice or thrice to make sure the post is having enough information for anybody to understand what is the problem and what is required.

Thanks and Regards

Raj
Re: row level [message #259746 is a reply to message #259729] Thu, 16 August 2007 06:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
To strenghen Raj's answer: I don't understand either.
I don't see any hierarchy.
I don't see why alan disappear.
I don't see anything.

Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Regards
Michel
Re: row level [message #259747 is a reply to message #259733] Thu, 16 August 2007 06:54 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Why not use ROWNUM?

SQL> SELECT LEVEL lv
  2       , ename
  3  FROM   emp
  4  CONNECT BY prior mgr = empno
  5  START WITH ename = 'SCOTT'
  6  /

        LV ENAME
---------- ----------
         1 SCOTT
         2 JONES
         3 KING

SQL>
SQL> SELECT LEVEL lv
  2       , ename
  3  FROM   emp
  4  WHERE  ename != 'JONES'
  5  CONNECT BY prior mgr = empno
  6  START WITH ename = 'SCOTT'
  7  /

        LV ENAME
---------- ----------
         1 SCOTT
         3 KING

SQL>
SQL> SELECT ROWNUM lv
  2       , ename
  3  FROM   emp
  4  WHERE  ename != 'JONES'
  5  CONNECT BY prior mgr = empno
  6  START WITH ename = 'SCOTT'
  7  /

        LV ENAME
---------- ----------
         1 SCOTT
         2 KING


MHE
Re: row level [message #259759 is a reply to message #259747] Thu, 16 August 2007 07:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maarten,

I don't know if this is the correct way to say it in english but I raise my hat to you.
I can't imagine this was the question.

Regards
Michel

[Updated on: Thu, 16 August 2007 08:57]

Report message to a moderator

Re: row level [message #259767 is a reply to message #259759] Thu, 16 August 2007 07:24 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
De rien Very Happy
Il y a pas de problèmes ici, Il y a que des solutions!



MHE

[Updated on: Thu, 16 August 2007 07:25]

Report message to a moderator

Re: row level [message #259768 is a reply to message #259767] Thu, 16 August 2007 07:26 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
./fa/1582/0/ Please, keep this part of the OraFAQ Forum in English!

Toggle Spoiler

[Updated on: Thu, 16 August 2007 07:27]

Report message to a moderator

Re: row level [message #259769 is a reply to message #259768] Thu, 16 August 2007 07:27 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
...and you got me. Me and my quick replies. Neutral

But look at the time you edited and I replied! We're on fire! High five!

MHE

[Updated on: Thu, 16 August 2007 07:29]

Report message to a moderator

Previous Topic: Batch File
Next Topic: Procedure owner rights works with DML but not with DDL
Goto Forum:
  


Current Time: Wed Dec 07 08:23:03 CST 2016

Total time taken to generate the page: 0.05669 seconds