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
How to connect php with different port numbers?
How to connect sql server management studio express to sql server 2005 express?
Issues related in upgrading SQL Server 2000 to 2005 / 2008
When you use @@error and try-catch?
What is the difference between left and right outer join?
What are the parts of a function?
What are group functions in query statements in ms sql server?
What is the default Port No on which SQL Server listens?
Do you know what is difference between stored procedure and user defined function?
How you would rewrite the sql query to return the customerid sorted numerically?
What is the federation in sql azure?
What is data source document?
What is ssl in sql server?
Is sql server free?
Is foreign key unique?