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 / mohit kumar singhal

Select emp.empname, emp.salary from emp right outer join (
select empname, salary from emp
group by empname, salary
having count(empname) > 1) as tbl
on emp.empname = tbl.empname

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to attach adventureworkslt physical files to the server?

1106


Explain the difference between primary keys and foreign keys?

1034


What are the differences between clustered and non-clustered index?

1033


What do you understand by SQL*Net?

1037


What is default constraint in ms sql server?

1042


What is database architecture? : SQL Server Architecture

1050


Explain what are various ways to enhance the ssrs report?

1045


What are user defined functions in ms sql server?

1004


What is log cache in sql server?

1049


Why do we use trigger?

975


what is hash nonclustered index

970


What are constraints in microsoft sql server?

1139


What are the different types of sql server replication? : sql server replication

1277


What are parameterized reports?

203


How to create “dependant” parameter “make, model, year”

132