How to find out the second largest element from mysql table
Answer Posted / prasad
select id from tbl_name order by id desc limit(1,1)
(selects 2nd highest id)
for nth highest
select id from tbl_name order by id desc limit(n-1,1)
Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What is row locking in mysql?
What is the purpose of using timestamp data type?
What happens if null values are involved in expressions?
How do I make an action query?
Do while loop in mysql procedure?
How do I set user privileges in mysql?
How to copy data from one server to another using php?
Are stored procedures precompiled?
How are mysql timestamps seen to a user?
How do I export mysql query results to excel?
How can we optimize stored procedure?
If we use sum function in mysql, does it return sum of that row or for that column?
What is the difference between sql and mysql and oracle?
How do I kill a mysql connection?
What is mysql optimization?