how to calcuate the second highest salary of he employee
Answer Posted / hari krishna j
SELECT A.SAL FROM EMP_TAB A
WHERE 1=(SELECT COUNT(*) FROM EMP_TAB B
WHERE B.SAL > A.SAL)
Change value of 1 if
0 - First heighest sal
1 - Second " "
2 - Third heighest sal
.
.
.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is nvarchar in sql?
What are the different ways to optimize a sql query?
Define commit, rollback and savepoint?
Is sql easier than java?
What is the difference between database trigger and stored procedure?
Is drop table faster than truncate?
what is the difference between $message and $$message? : Sql dba
What is type and rowtype in pl sql?
What action do you have to perform before retrieving data from the next result set of a stored procedure ?
Define tables and fields in a database
What is the difference between a primary key and a unique key?
What are the different dcl commands in sql?
how to rename an existing column in a table? : Sql dba
How can the performance of a trigger be improved?
What is pl sql architecture?