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

What are the hotfixes and patches in sql server?

1017


What is resource db in sql server?

1023


Explain various data region available in ssrs with their use?

933


How to write a query with a left outer join in ms sql server?

983


Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

881


What are the encryption mechanisms in sql server?

1028


Why is the need for data conversion transformations?

1063


What do you understand by the denormalisation?

956


how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

1682


What is the difference between Triggers and Stored Procedure?

1095


what is a self join? : Sql server database administration

1036


You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

985


is it important for a database administrator to understand the operating system and file access? : Sql server administration

1029


What is difference between order by and group by?

1004


How do I find the size of a sql server database?

928