Home » SQL & PL/SQL » SQL & PL/SQL » [Connect By] Clause Problem (Oracle 9i,9.2.0.6.0,Windows XP)
[Connect By] Clause Problem [message #325153] Thu, 05 June 2008 03:03 Go to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
I want to generate numbers from 1 to 31 in a single SQL query.
This can be done via Pipelined Function.

But with this query we can achieve the same results but i am getting problem that this query is returning values from 1 to 25 only not from 1 to 31.why??

SELECT LEVEL
 FROM dual
 CONNECT BY LEVEL<=31


Is their any limitation on connect by clause
Re: [Connect By] Clause Problem [message #325154 is a reply to message #325153] Thu, 05 June 2008 03:09 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I'll gess that you're running something earlier than 10g R2.

Try this:
SELECT lvl
FROM (SELECT level lvl
      FROM   dual
      CONNECT BY level <=31)
Re: [Connect By] Clause Problem [message #325156 is a reply to message #325153] Thu, 05 June 2008 03:11 Go to previous message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
Thanks JRowbottom it worked.

Previous Topic: How to calculate the Bytes of multibyte character.
Next Topic: what is the Best Index for a column which can be a null
Goto Forum:
  


Current Time: Sat Dec 10 09:14:56 CST 2016

Total time taken to generate the page: 0.12838 seconds