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 / enis ertem

Select emp.empname, emp.salary from employee emp join (
select empname, salary from employee emp
group by empname, salary
having count(empname) > 1) as tbl
on emp.empname = tbl.empname

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are secondary xml indexes?

668


Define right outer join in sql server joins?

606


Determine when to use stored procedure to complete sql server tasks?

611


What is the difference between functions and scalar functions?

653


Which database stores information about replication?

626






Explain how many types of relationship?

665


What are sub reports?

160


Is null vs coalesce?

578


What does dml stand for?

592


What are the different types of replication are there in sql server 2000?

655


How to concatenate two character strings together?

666


How do I schedule a sql server profiler trace?

617


what data regions are and what are the different data regions?

107


How to assign new column names in a view?

587


how to invoke a trigger on demand? : Sql server database administration

642