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

What are different types of statements that are supported by sql?

985


What are xml indexes?

894


What is database replication?

1079


What extended events?

955


Can You Use Data Mining Models In Ssrs?

139


Can you pass expressions to stored procedure parameters?

972


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

979


What is difference between count (*) and count column?

841


How many types of local tables are there in sql server?

889


what is datawarehouse?

1057


How to create a store procedure with encryption?

953


Tell me about pre-defined functions of sql?

1072


What is the current limitation of the size of SQL Azure DB?

124


Can I disable or restrict ssrs export formats (rendering formats)?

140


Explain about system database?

1002