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
Define synonym?
What is the purpose of the master database?
Why use update_statistics command in sql server?
How to select some specific columns from a table in a query in ms sql server?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
What are the different subsets of sql?
Can you tell me about the concept of ER diagrams?
What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration
List some advantages and disadvantages of stored procedure?
How to get a list of columns in a view using "sys.columns" in ms sql server?
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
Can the “if update (colname)” statement be used in a delete trigger?
How can you hide the sql server instances?
How do I install sql server?
What are different types of database indexes?