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 |
Explain about the command-line tool SQLCMD?
how to get the maximum among two tables,for example table 1 (dep1) have (emp_id,emp_name,salary) columns and table 2 (dept2) have (emp_id,emp_name,salary) columns,i want which employee have the maximum salary among two tables?
What is candidate key with example?
Tell me what is use of except clause? How it differs from not in clause?
What is trigger and different types of Triggers?
How to change the data type of an existing column with "alter table" statements in ms sql server?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
What's the purpose of Stored Procedure?
difference between Clustered index and non clustered index ?
How to delete a login name in ms sql server?
What are the types of normalization?
what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?