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 can you attach more than 20 ldf files in sql server
Explain sql server service broker?
What is rank function?
What causes index fragmentation?
What is a with(nolock)?
Do you know the isolation level that sql server support?
How do I setup a sql server database?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
What are the differences between clustered and non-clustered index?
What is difference between materialized view and view?
What is difference between unique and primary key?
You want to implement the one-to-many relationship while designing tables. How would you do it?
Explain “@@rowcount” and “@@error” in sql server?
What is sql or structured query language?
How global temporary tables are represented and its scope?