please give me the answer for this:
query which generates the second highest integer in the table?
Answers were Sorted based on User's Feedback
Answer / river
SELECT * FROM `student` where class='Six' ORDER BY mark desc
LIMIT 1,1
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / salil
Without using LIMIT
SELECT max( t1.col )
FROM `table` t1
WHERE t1.col < (SELECT max( t2.col ) FROM `table` t2);
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sunil kumar
Sorry I have a mistake in above answer. The right answer is
select marks from tablename order by marks desc limit 1,1
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / hamza tariq
select marks from tablename order by marks desc limit 1,1
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sunil kumar
select marks from tablename order by age desc limit 1,1
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vardhan rao
With Limit: nth highest salary
Select distinct(salary) from tablename order by salary desc
limit n-1,1
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / richa
This is a general solution to nth level of salary
Select salary from (select salary from table order by salary
desc limit 3) tbl order by salary limit 1
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / prasun
SELECT * FROM `student` where class='Six' ORDER BY mark desc
LIMIT 0,1
| Is This Answer Correct ? | 1 Yes | 4 No |
What is the use of i-am-a-dummy flag in mysql?
What are the purposes of using enum and set data types?
How to Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.
How do I start mysql client?
What is heap table?
How to start mysql server?
How to print message in mysql trigger?
What is the default port for mysql and how it can change?
Does mysql use sql?
How many sql dml commands are supported by 'mysql'?
what is the difrence between sql and pl/sql
Explain federated tables?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)