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 are different types of statements that are supported by sql?
What are xml indexes?
What is database replication?
What extended events?
Can You Use Data Mining Models In Ssrs?
Can you pass expressions to stored procedure parameters?
is it important for a database administrator to understand the operating system and file access? : Sql server administration
What is difference between count (*) and count column?
How many types of local tables are there in sql server?
what is datawarehouse?
How to create a store procedure with encryption?
Tell me about pre-defined functions of sql?
What is the current limitation of the size of SQL Azure DB?
Can I disable or restrict ssrs export formats (rendering formats)?
Explain about system database?