Hi,
I have a table A which has four rows as follows
Table A
-------
empname salary
------- ------
A 1000
B 2000
C 3000
A 1000
B 2000
D 5000
I need the following output:
empname salary
------- ------
A 1000
A 1000
B 2000
B 2000
Thanks in advance
Answer Posted / kuntal
select * from A where empname in (select empname from A
group by empname having COUNT(*)>1)
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the different types of sql server replication? : sql server replication
How to use clusters?
Can we perform backup restore operation on tempdb? : sql server database administration
Explain about unique identifier data type in sql server?
Define ACID properties in a Database?
What is the difference between resultset and resultsetmetadata?
What is abstracting periodical?
In what sequence sql statement is processed?
How can we call UDF(User Define Function) using C# code in ASP.net ?
What are the extra roles available in msdb? : sql server security
What are the new features in sql server 2016?
Explain what is lock escalation and what is its purpose?
What are the different authentication modes in sql server? How can it be changed?
What do you understand by recursive stored procedures?
Can you use order by when defining a view?