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

Determine when to use stored procedure to complete sql server tasks?

1033


Write down the syntax and an example for create, rename and delete index?

959


How to identify current user in ssrs report?

401


What is rs.exe utility?

156


What is data file in computer?

922


What is the primary use of the model database?

1064


what is create database syntax? : Sql server database administration

1083


What is database black box testing?

1012


Explain what is the function of sql server agent windows service?

974


What is sql service broker?

964


What is an expensive query?

912


What are types of subqueries?

1036


How to access the inserted record of an event?

1026


What is bulkcopy in sql?

931


What is the difference between left and right outer join?

1049