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 / goutam dey

select empname,salary from tableA
groupby empname
having count(empname)>1

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of keyword with encryption.

576


What are the different types of Indexes available in SQL Server?

517


how to overcome kernel isssues

1168


What is the openxml statement in sql server?

536


List out the differences between global and local temp tables in sql server?

569






How to execute stored procedure and set temp table in sql server?

550


How many types of subqueries are there in sql server?

461


Is mysql better than sql server?

538


Explain following error properties?

555


What is the cartesian product of the table?

544


What are different types of roles provided by ssrs?

112


What is identity?

548


What is microsoft sql server?

537


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

1571


Can two different columns be merged into single column? Show practically?

606