Given an employee table, how would you find out the second
highest salary?
Answer Posted / karna
select top 1 a.salary,* from emp a
where a.salary not in(select top (n-1) b.salary from emp b)
here n is the Nth values:if you want secong highest: keep n
as 2 so the query will become
select top 1 a.salary,* from emp a
where a.salary not in(select top 1 b.salary from emp b)
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
You have a table with three columns: amount1, amount2, and amount3 in a single row only one of these three columns will have a value and the other two will be null. Write a sql query to retrieve the values from these columns?
Hi , any one can help me on the same,this is regarding the Informatica Function doc,i want to know how developer is will develop the mapping. pl forwar the any function doc .just for my references. svlc75@yahoo.co.in
What is the maximum length of an extended property?
Can an extended stored procedure be called from inside a user-defined function?
Pgm A calls Pgm B and pgm B uses cursor, when pgm B is called second time, the program is abending saying the cursor is opened? Why?
Explain about normal forms?
Where is dbms used?
What is dbms explain in brief?
In which database can extended stored procedures be added?
How you can make a parameterized view?
What are the 18 schemas?
Explain about the storage and physical database design?
Explain the process of the user request and data generating?
On friday, you issued several insert statements using query analyzer. You then verified the data had been correctly entered with a select statement on monday, your users report that the data is not there what happened?
How to use timestamp datatypes