sql - Oracle select top N rows based on Values -


say if have table following column,

marks 60 80 70 90 95 90 70 

i need select rows mark in top 4, ie. in case, >=70 , 6 rows should returned.

i'm not sure how this, can please? thanks.

select marks (   select marks, dense_rank() on (order marks desc) marksrank   yourtable ) marksrank <= 4 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -