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: Sql Query - Help

RE: Sql Query - Help

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Wed, 1 Jun 2005 13:47:26 -0400
Message-ID: <001101c566d1$f90d65d0$2004a8c0@development.perceptron.com>


Why not:

Select * from (

	Select id, rownum rn 
		from emp_dtl 
		where 1 = 1 AND Group='WHO' 
		and Cust_acct='GE' and Update_tag = 'F' and
Category_code=1 		order by Acct_num, seq_number )
	where rn >= 50
	and rn < 100;

btw., what's oracle version?

Igor Neyman, OCP DBA
ineyman_at_perceptron.com

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Sanjay Mishra Sent: Wednesday, June 01, 2005 12:30 PM
To: oracle-l_at_freelists.org
Subject: Sql Query - Help

I had query  

select * from

(select inner.*, rownum rn from

(select ID from emp_dtl where 1 = 1 AND Group='WHO' and Cust_acct='GE'
and Update_tag = 'F' and Category_code=1 order by Acct_num, seq_number )inner

 where rownum < 100)

where rn >= 50  

The Inner Portion run in few second , while the reamining query takes ages like 40-45minutes. Any idea as what I am missing or any optimization.  

TIA Sanjay                 



Discover Yahoo!
 Get on-the-go sports scores, stock quotes, news & more. Check it out!
--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 01 2005 - 13:52:18 CDT

Original text of this message

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