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 / mohit kumar singhal
Select emp.empname, emp.salary from emp right outer join (
select empname, salary from emp
group by empname, salary
having count(empname) > 1) as tbl
on emp.empname = tbl.empname
Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
What is the default server name for sql server?
How to use subqueries with the exists operators in ms sql server?
Explain about service Broker functions?
Can a table be moved to different filegroup?
Explain powershell included in sql server 2008?
How much is a sql server license?
What are cascading parameters in ssrs reports?
Define synonym?
Define model database?
Detail about query optimizer?
What are the transaction properties?
How to find the login name linked to a given user name?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
What is a collation in ms sql server?
List out some of the requirements to set up a sql server failover cluster?