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

explain different types of joins? : Sql server database administration

924


How you can find out if an index is useful to the optimizer?

873


How to execute function in stored procedure sql server?

1052


What is tcl in sql server?

1080


What are “lock” hints?

999


How do I find the sql server version?

958


What is the difference between functions and scalar functions?

1127


What are filegroups in sql server?

1014


How do I clean up sql server transaction log?

995


How to set database to be single_user in ms sql server?

970


What is the difference between implicit and explicit transaction?

964


Is a null value equal to anything? Can a space in a column be considered a null value? Why or why not?

996


System requirements for sql server 2005 express edition?

954


How do I make a resultset scrollable?

911


How many categories of data types used by sql server?

969