1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / ashwini
2. Second highest salary from the table
select top 1 salary from emp where salary NOT IN
(SELECT MAX(salary) FROM emp)order by salary desc
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Where are sql server usernames and passwords stored in the sql server?
Define synonym?
What is the filtered index?
How many types of attribute relationships are there? : sql server analysis services, ssas
How to get the definition of a stored procedure back?
What is a covering index?
Which are the third-party tools used in sql server and why would you use them?
Which language is supported by sql server?
Tell me what is the stuff and how does it differ from the replace function?
How to write an inner join with the where clause in ms sql server?
Explain Normalization and DE normalization
How to assign new column names in a view?
Can we shrink data file in sql server?
How to select all columns of all rows from a table with a select statement in ms sql server?
What are logical/boolean operations in ms sql server?