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
Answers were Sorted based on User's Feedback
Answer / sridhar
select gross_pay from tbl_payroll where gross_pay != (select
max(gross_pay) from tbl_payroll) limit 0,3
Is This Answer Correct ? | 0 Yes | 8 No |
Answer / rajeev
select salary-1 from users where salary in (select
max(salary) from users);
Is This Answer Correct ? | 0 Yes | 8 No |
Answer / ashish kumar
To find nth maximum salry
Select salary from tbl_name a where
n-1=(Select count(distinct(count(*))) from tbl_name b
where b.salary>a.salary)
Is This Answer Correct ? | 10 Yes | 20 No |
Answer / gunjan sapra
select top 10 from tbl_name order by salary desc
Is This Answer Correct ? | 4 Yes | 39 No |
What is the primary use of the model database?
How do you optimize Sql queries ?
How many joins in sql server?
Explain the concepts and capabilities of sql server?
How To Change Column Ordinal Position in SQL Server 2005 using Query i.e I Want To Add Column at Particular Ordinal Position in SQL Server 2005
if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration
Explain having clause?
In what sequence sql statement is processed?
Join 3 tables (table1, table2 & table3) in a single query. Inner join should be applied for table1 & table 2 and left outer join for table1 & table3 where table2.dept is ABC
What is the sql profiler?
What does Master database contains?
what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration