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
How can I check if a view exists in a sql server database?
What is a transact-sql statement batch in ms sql server?
What happens when converting big values to numeric data types?
What is a partition key?
What is lookup override?
How can we solve concurrency problems?
How do I port a number to sql server?
Can you explain what is indexed view? How to create it?
Tell me what are the advantages of using stored procedures?
how to use DTS package in 2000,2005,2008 in sql server
What is difference in performance between insert top (n) into table and using top with insert?
What is acid properties?
Why truncate is ddl command?
What is lock escalation? : sql server database administration
what is the different types of backups available in sql server? : Sql server database administration