Write a query to find second highest salary of an employee.
Answer Posted / versaites
select top 1 emp_total_sal,emp_name from (
select top 2 emp_total_sal,emp_name from employee_table
ORDER BY emp_total_sal DESC) a
ORDER BY emp_total_sal ASC
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
The in operator may be used if you know the exact value you want to return for at least one of the columns.
What are local and global Indexes and where they are useful.
what is the difference between char_length and length? : Sql dba
Why do we use procedures?
What is java sql driver?
Does sql support programming?
how to create a test table in your mysql server? : Sql dba
What are reports usually used for?
How do you rank data in sql?
What is a sql instance vs database?
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
What is a temp table?
What are primary key and foreign key and how they work?
How to display Row Number with Records in Oracle SQL Plus?
What does count (*) do in sql?