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
You want to implement the one-to-many relationship while designing tables. How would you do it?
what is a deadlock? : Sql server database administration
What command is used to create a database in the sql server and how?
How to insert and update data into a table with "insert" and "update" statements?
How to download and install microsoft sql server management studio express?
How to return the top 5 rows from a select query in ms sql server?
What are the types of stored procedures in an sql server?
what is a join? : Sql server database administration
What is a performance monitor?
How do you use a subquery to find records that exist in one table and do not exist in another?
What is page in sql server?
What is the difference between index seek vs. Index scan?
Which sql server table is used to hold the stored procedure script?
What is report subscription?
How to drop an existing table?