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 triggers? : Sql server database administration
Can two tables have the same primary key?
What happens on checkpoint?
What are the rules to use the rowguidcol property to define a globally unique identifier column?
Can truncate be rolled back?
Which tcl commands are available on the sql server?
What are the different type of replication in sql server?
Can two tables share the same primary key?
How to see the event list of an existing trigger using sys.trigger_events?
List out what other servers you can use with ssrs?
What is the main difference between ‘between’ and ‘in’ condition operators?
What is database isolation in sql server? : sql server database administration
Explain what is “asynchronous” communication in sql server service broker?
How many categories of functions based their return modes?
What is abstracting periodical?