php - How to find the rank of a particular row value? -


this question has answer here:

i have table name 'points' shown below,

name | point abc    10 cde    5 efg    15

how find rank of particular name?

for example: rank 3 cde in above case

a simple way (though requires knowing how many points name has) count rows above it

select count(*) rank tbl points > '%d' 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -