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

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

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You want to implement the one-to-many relationship while designing tables. How would you do it?

996


what is a deadlock? : Sql server database administration

1150


What command is used to create a database in the sql server and how?

1243


How to insert and update data into a table with "insert" and "update" statements?

1046


How to download and install microsoft sql server management studio express?

1096


How to return the top 5 rows from a select query in ms sql server?

1209


What are the types of stored procedures in an sql server?

1036


what is a join? : Sql server database administration

1327


What is a performance monitor?

1024


How do you use a subquery to find records that exist in one table and do not exist in another?

1090


What is page in sql server?

997


What is the difference between index seek vs. Index scan?

1066


Which sql server table is used to hold the stored procedure script?

1006


What is report subscription?

132


How to drop an existing table?

1053