Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are logical/boolean operations in ms sql server?

1037


What is buffer cash and log cache in sql server?

1122


explain what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration

933


What is sql server programming?

1040


What is temporal table?

887


What is sqlservr.exe - process - sql server (sqlex?press)?

1107


What are orphan records?

929


What is it unwise to create wide clustered index keys?

1007


What are cascading parameters in ssrs reports?

229


What is inner join in sql server joins?

1035


What are trace flags?

1030


What are clustered and non-clustered index?

1008


What is a hint?

991


how can a database be repaired? : Sql server administration

971


What is the difference between for auto and for nested?

1001