how to find the second highest salary from emp table?
Answer Posted / prudhvi
select sal from emp a where 1=(select count(*) from emp b where a.sal>b.sal);
Try this guys,if u want highest sal use 0 in where condition, for second highest 1,third 2........
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Show code of a cursor for loop.
What does where 1 1 mean in sql?
What is query optimization in sql?
how to load data files into tables with 'mysqlimport'? : Sql dba
How to rename a table?
What is the difference between having and a where in sql?
What is the difference between a procedure and a function?
how would concatenate strings in mysql? : Sql dba
Which sql statement is used to return only different values?
What is dml statement?
What do you understand by pl/sql packages?
What is rownum in sql?
how many ways we can we find the current date using mysql? : Sql dba
What is dense_rank?
How many clustered indexes can be created on a table?