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
What is a composite primary key?
What is sqlerrd?
How do I find duplicates in two columns?
What is the starting oracle error number?
What are pl sql data types?
What are the advantages of indexing?
How do I delete a trigger?
Which language is used in sql?
What are sql indexes?
What is optimistic concurrency control? : Transact sql
What are the syntax and use of the coalesce function?
What is a constraint?
What is sql and how does it work?
discuss about myisam index statistics collection. : Sql dba
Is oracle and sql same?