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

How to use copy and concatenate commands in SQL?

597


Does server sql treat char as a variable-length or fixed-length column?

578


What are the advantages of partitioning?

638


Suggest a method of joining two tables.

598


How to find out the list schema name and table name for the database?

524






What is cte (common table expression)?

593


What are the system database in sql server 2008?

571


What is normalization process?

595


What is sql collation?

648


Explain transaction server implicit?

515


Does index speed up select statements?

581


What is the difference between dbcc indexdefrag and dbcc reindex?

517


what is the different types of backups available in sql server? : Sql server database administration

497


What is the sql server 2000 version number?

548


What is lock escalation and what is its purpose?

555