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 is store procedure? How do they work? When do you use?

686


What command is used to create a database in the sql server and how?

827


What types of Joins are possible with Sql Server?

766


What is best institute to Learn DotNET And SQL in chennai?

1893


How to create database with physical files specified in ms sql server?

722






Explain “row_number()” in sql server with an example?

716


Explain what are the authentication modes in sql server?

677


What is the difference between SQL notification and SQL invalidation?

780


Is sql server 2016 free?

695


Which are the new data types introduced in sql server 2008?

667


Can We Use Data-grids For Our Report In Ssrs?

163


How to find the list of fixed hard drive and free space on server?

779


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

726


How does Report Builder support Analysis Services cubes?

136


What is the exact numeric data type in sql?

724