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

What is row_number function?

940


What is sql server locking?

936


What is a scheduled job or what is a scheduled task?

910


What is the chart in report?

142


what type of index will get created after executing the above statement? : Sql server database administration

919


What is Federation and Federation Member?

92


Detail about query optimizer?

1032


What are ddl (data definition language) statements for tables in ms sql server?

1025


Can a synonym name of a table be used instead of a table name in a select statement?

973


What is pivot and unpivot?

974


tell me the disaster recovery plan

2455


How to add an address record into adventureworkslt?

931


How to create hyperlink from returned sql query ?

1070


What is the use of floor function in sql server?

1022


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

975