Write a query to find second highest salary of an employee.
Answer Posted / gvmahesh
I write the query for this question using OLAP functions.
select e1.* from (select ename,sal,rank()
over(order by sal desc) rank from emp) e1
where e1.rank=2;
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What are the types of optimization?
Can we use ddl statements in stored procedure sql server?
Can we use the cursor's to create the collection in PL/SQL?
What is the command used to fetch first 5 characters of the string?
How do I turn a list into a table?
What is synonyms?
Which join is default?
Why procedure is used in sql?
what is 'mysqld'? : Sql dba
how to include comments in sql statements? : Sql dba
how can we know the number of days between two given dates using mysql? : Sql dba
Can we create table in function?
what are all the common sql function? : Sql dba
Can a key be both primary and foreign?
What are sql data types?