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
Explain different types of self contained sub query?
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
What are the purpose of Normalisation?
Is sql different from sql server?
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
What to check if a User database is locked?
Define outer join in sql server joins?
What is ms sql server service broker?
What is equi join with example?
What is tablesample?
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
What are triggers? How do you invoke a trigger on demand?
How can you append an identity column to a temporary table?
What is the difference between composite index and covering index?
What are the types of user defined functions in sql server?