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

Home -> Community -> Usenet -> c.d.o.server -> Help with SQL Statement

Help with SQL Statement

From: <yitbsal_at_statcan.ca>
Date: 1999/01/26
Message-ID: <78kt20$332$1@nnrp1.dejanews.com>#1/1

Hi,

I am trying to get the tenth record as ordered by col2. The following SQL statement returns errors on parsing:

select *
from table1 a
where 10 =
(select count(*)

from table1 b
where a.col2 >= b.col2);

Substituting the 'in' operator for the '=' works. However, I have a more general problem. I'd like to say:

select *
from table1 a
where (10,..,20)
(select count(*)

from table1 b
where a.col2 >= b.col2);

That is, I want to get the records from position 10 through 20, as ordered by col2. This does not work, and I don't see a workaround.

Help?!

Thanks,
Salaam Yitbarek

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 26 1999 - 00:00:00 CST

Original text of this message

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