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
List all the types of user-defined functions?
What samples and sample databases are provided by microsoft?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
What's the information that can be stored inside a bit column?
what are the three command line utilities and what are their primary functions?
How to select an exiting database using mssql_select_db()?
What methods do you follow to protect from sql injection attack?
What is statement level trigger?
Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?
What is sql server profiler trace data file?
What are the dis_advantages of stored procedures, triggers, indexes?
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
What is mean by dml?
How can you start sql server in different modes?
In what sequence sql statement is processed?