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 / vinay
select empname , salary
from A
where empname in (select name from A group by empname
having count(empname ) > 1)
order by empname
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is difference between count (*) and count column?
What is the use of keyword with encryption. Create a store procedure with encryption?
What is local temp table?
What does COMMIT command do?
What is the function of sql server agent windows service?
What is a rownum?
Tell me what is de-normalization and what are some of the examples of it?
What are the differences between ms sql server & oracle?
List down some advantages of sql stored procedure?
You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?
Explain the different types of joins?
What are the general features of sql server management studio? : sql server management studio
How many instances per computer are there in sql server 2000?
How do I install sql server?
What samples and sample databases are provided by microsoft?