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
How to attach adventureworkslt physical files to the server?
Explain the difference between primary keys and foreign keys?
What are the differences between clustered and non-clustered index?
What do you understand by SQL*Net?
What is default constraint in ms sql server?
What is database architecture? : SQL Server Architecture
Explain what are various ways to enhance the ssrs report?
What are user defined functions in ms sql server?
What is log cache in sql server?
Why do we use trigger?
what is hash nonclustered index
What are constraints in microsoft sql server?
What are the different types of sql server replication? : sql server replication
What are parameterized reports?
How to create “dependant” parameter “make, model, year”