hi all,
there is a table in which there is one column whose datatype is numeric. in this there are 300 rows. i want 250th maximum value of that table. how we can get it.
bye
thanks
Printable View
hi all,
there is a table in which there is one column whose datatype is numeric. in this there are 300 rows. i want 250th maximum value of that table. how we can get it.
bye
thanks
I would suggest you read the chapter on RANKING in SELECT-statements. With that clause you can rank your data. After that it's easy to filter out the 250th value.
HTH,
Erik
Here is an example (if your Oracle is 8.1.6 or above)
create table t as select rownum c from dba_objects
where rownum <=300;
select c from (
select c, rank() over (order by c) r from t)
where r=250
/
C
----------
250