1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / sneha s
fetch duplicate records from table:
select column_name from table_name group by column_name having count(column_name)>1;
get the second highest salary:
select distinct salary from emp order by salary desc limit 1,1;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between a stored procedure and a user defined function?
What is difference between drop truncate and delete?
What is a natural primary key?
Please illustrate physical database architecture? : SQL Server Architecture
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
Write a query for primary key constraint with identity key word?
Explain iaas, paas and saas?
Why transaction is important?
What is primary key index?
What is blocking?
What extended events?
Write query to return all rows sql?
How many categories of functions based their return modes?
in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration
What are logical/boolean operations in ms sql server?