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 / kuntal
select * from A where empname in (select empname from A
group by empname having COUNT(*)>1)
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain differences between web edition and business edition?
When to use null data driven subscription?
what is memory-optimized nonclustered indexes
How are the unique and primary key constraints different?
Explain primary key and foreign key constraints?
Explain a checkpoint?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
Where do you find the default Index fill factor and how to change it?
How to execute a sql statement using odbc_exec()?
Explain transaction server explicit transaction?
What is the difference between TRUNCATE and DROP?
How to filter records of table in SQL SERVER?
What is importing utility?
What is the difference between a unique key and primary key?
How do I edit a stored procedure in sql server?