Home » Other » Training & Certification » Level in sequence query..
Level in sequence query.. [message #260366] Sun, 19 August 2007 02:25 Go to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
hello DBA Gurus,

in the answer of thread http://www.orafaq.com/forum/t/87493/102855/
, in the select query for fetching next value, LEVEL clause is used in where clause..

I dont know about that, neither i came to read about it during studying the sequence..
Can anyone please tell me its purpose and use or state some online material where i can study it..

Thanking you..

Dipali
Re: Level in sequence query.. [message #260377 is a reply to message #260366] Sun, 19 August 2007 06:26 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It has nothing to do with sequence, it is just a row generator.
Don't think connect as an independant clause.
Consider the whole "select level from dual connect by level <= N" as an instruction to generate N rows.

Regards
Michel
Re: Level in sequence query.. [message #260395 is a reply to message #260377] Sun, 19 August 2007 09:23 Go to previous messageGo to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
Thanks michel cadot..
so,

"connect by level <= N"

means This clause is used to get N number of rows (as we use rownum for that purpose) .

Am i interpreating right, mr cadot??


Regads..
Dipali
Re: Level in sequence query.. [message #260402 is a reply to message #260395] Sun, 19 August 2007 09:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No.
"select level from dual connect by level <= N"
is used to get N rows.
It is a whole and one statement.

Regards
Michel
Re: Level in sequence query.. [message #260403 is a reply to message #260402] Sun, 19 August 2007 10:06 Go to previous message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
this is new thing to learn for me.. Smile
Thanks michel...


regards..
Dipali
Previous Topic: regarding crusors,procedure & functions?
Next Topic: Password Verify Function.
Goto Forum:
  


Current Time: Fri Apr 26 02:34:54 CDT 2024