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
What are information schema views?
What are the different types of sub-queries?
What is the chart in report?
What is transaction server explicit transaction?
How to achieve Paging of records in SQL SERVER?
What stored by the master? : sql server database administration
What is index, cluster index and nonclustered index?
What is the stuff and how does it differ from the replace function?
What are the properties of sub-query?
What is Extended user-defined?
What is a trigger what are the advantages of trigger?
What is the command dbcc checkdb used for?
What types of replication are supported in sql server?
what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration
What are rest-style architecture's?