Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Corrected SQL Question...

Re: Corrected SQL Question...

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Thu, 13 Mar 2003 14:49:06 -0800
Message-ID: <F001.00569AB3.20030313144906@fatcity.com>


Igor Neyman wrote:
>
> Kirti,
>
> What about solution suggested by Stephane Faroult:
>
> select *
> from (select *
> from T
> connect by col1 = prior col2
> and col1 > col2) x
> where rownum <= (select count(*) from T)
> /
>
> ?
>
> Igor Neyman, OCP DBA
> ineyman_at_perceptron.com
>

Igor,

 I can answer that - col1 > col2 worked with the first sample of data, not with the second one. The problem is with the loops in the tree - CONNECT BY doesn't like round-trips from an airport and back! And since you cannot put a subquery in a CONNECT BY, you're toast.   I think, though, that you can probably use the tree walk if you do it in PL/SQL with a bulk select in an array. Previous experiments have shown to me that when the exception is raised, the data is returned anyway. Needless to say, it becomes messy :-).  

-- 
Regards,

Stephane Faroult
Oriole Software
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Mar 13 2003 - 16:49:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US