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
Explain following error properties?
How to copy data from one table to another table?
Can you insert NULL in unique column?
How to change the system date and time from SQL Plus Terminal ?
what are the different types of SSRS reports?
How to create a login account in ms sql server to access the database engine using "create login" statements?
What is sql view?
Write a code to select distinct records without using the DISTINCT keyword.
What are relationships and mention different types of relationships in the dbms
What is the difference between a check constraint and a rule?
Does view occupy space?
How to store and query spatial data?
What is the purpose of sql profiler in sql server?
Explain why variables called the most powerful component of ssis?
How to delete a login name in ms sql server?