How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / g
TO FIND THE 3rd,
select max(sal) from emptable where salary not in(select
distinct top 2 sal from emptable)
TO FIND THE 4th,
select max(sal) from emptable where salary not in(select
distinct top 3 sal from emptable)
TO FIND THE 5th,
select max(sal) from emptable where salary not in(select
distinct top 4 sal from emptable)
keep change top value...
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is a join in sql?
What are two difference between sql azure and azure tables?
How can windows applications connect to sql servers via odbc?
Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?
What are partitioned views and distributed partitioned views?
How can I add Reporting Services reports to my application?
Tell about MOM Tool(Microsoft Operator Manager)?
What are sparse columns?
how many type of indexing in database?
What are the functions in sql server?
What you can do to delete a table without the delete trigger firing?
Why do we use sql limitations? Which constraints can we use while making a database in sql?
Describe how to use the linked server?
What’s the distinction between dropping a info and taking a info offline?
What are synonyms?