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 / anand

select empname,salary from tableA where(empname in (select
empname from tableA group by empname having count(empname)
>1))order by empname

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

1011


How except clause is differs from not in clause?

938


What is page-level compression?

942


What is bcp? When does it used?

964


Why is normalisation important?

927


Define magic tables in sql server?

1035


Delete duplicate rows without using rowid.

1527


What is the difference between count and distinct count?

871


What are filegroups in sql server?

1047


How to find related tables in sql server?

912


How to find tables without indexes?

1075


What is bit data type? What's the information that can be stored inside a bit column?

904


What are database states in ms sql server?

1162


While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?

109


What is difference between materialized view and view?

897