Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Performance & Tuning >> About "Connect by Prior".. any suggestion, please

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.



  


 Title: About "Connect by Prior".. any suggestion, please
 Majda  Posted: Dec 05, 2005 02:14:42 PM

 Total Post: 3
 Joined: Dec, 2005






 Hello every Dba and every body,

Here is my SQL order and I try to re-write it, because it's so slow ...
but I don't know how to do ... Because, I'm not used to work with "connect by"

"
select max(col3)
from toto
having rownum = 1
group by rownum
connect by prior col1 = col2
start with col2 = 'TTTT';
"

Thank you very much in advance.

 Vigyan
Posted: Dec 05, 2005 02:33:28 PM  

 Total Post: 386
 Joined: May, 2001






 
Did you tried running queries without the following.

having rownum = 1
group by rownum

Do you need it?

Vigyan


 Majda
Posted: Dec 05, 2005 02:44:05 PM  

 Total Post: 3
 Joined: Dec, 2005






 
hi Vigyan,

In fact, I don't understand this order ...
It was is writed by another user who left our service.
And I'm not used to work with "connect by Prior" ...

I dont' understand what is the utility of "rownum=1" on "Connect Prior order" ...

If anyone has any idea, thank a lot ...

 Vigyan
Posted: Dec 05, 2005 03:28:48 PM  

 Total Post: 386
 Joined: May, 2001






 
I dont think, you need rownum condition.

Read the document for Oracle Hierarchical queries at the following link.

http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/gennick_connectby_pt2.html

Hope it helps.

Vigyan

 Time Zone: EDT

  




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 Khokhar815
  Mohammed Taj704
  Jayanta Sur479
  positive fanatic416
  Vigyan Kaushik386
  Gitesh Trivedi322
  Gopu Gopi242
  neeraj sharma231
  Ramesh Jois226
  Bishal Khetan196






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software