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


Please Help Members By Posting Answers For Below Questions

What are the underflow and overflow behaviors on float literals?

1098


What is not null constraint?

1091


If user is owning any SQL Objects, can we drop that user

2051


What happens if null values are involved in arithmetic operations?

989


Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

990


Why are you getting errors when creating a new odbc dsn?

1202


Define candidate key, alternate key, and composite key.

906


What is a transact-sql statement batch in ms sql server?

995


What is SQL Azure Data sync?

119


What is the difference between inner join and equi join?

973


Do you know the capabilities of cursors?

1131


What is efficiency data?

940


Why use “in” clause in sql server?

1053


Is it important for a database administrator to understand the operating system and file access?

965


What is Federation and Federation Member?

92