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 append query?
In which format data is stored in mysql database?
How do you stop an access query?
SELECT country,city FROM customers GROUP BY country ORDER BY city DESC
How do I install the latest mysql on ubuntu?
What is not null in mysql?
How to include comments in sql statements?
How do I run mysql without installing?
How to dump one database for backup.
How do I grant privileges to a user in mysql phpmyadmin?
How many sql dml commands are supported by 'mysql'?
How to get last inserted id after insert data from a table in mysql?