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 / goutam dey
select empname,salary from tableA
groupby empname
having count(empname)>1
Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
How to defragment table indexes?
What is the architecture of ms sql reporting service?
Define Unique Key?
Types of Authentications in Sql Server? How user gets authenticated through windows authentication?
Explain features and concepts of analysis services?
What are key, name and value columns of an attribute? : sql server analysis services, ssas
Can sql server 2016 run on windows 7?
What are different types of data sources?
What is stored in the mssqlsystemresource database? : sql server database administration
What is a hint?
What are various limitations of the views?
When multiple after triggers are attached to sql table, how to control the order of execution?
What do you understand by triggers?
What is the difference between dropping a database and taking a database offline?