Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Help with SQL Statement
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