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 can you attach more than 20 ldf files in sql server

1984


Explain sql server service broker?

956


What is rank function?

1013


What causes index fragmentation?

974


What is a with(nolock)?

966


Do you know the isolation level that sql server support?

947


How do I setup a sql server database?

1053


What is scd (slowly changing dimension)? : sql server analysis services, ssas

992


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

1003


What is difference between materialized view and view?

896


What is difference between unique and primary key?

889


You want to implement the one-to-many relationship while designing tables. How would you do it?

938


Explain “@@rowcount” and “@@error” in sql server?

1061


What is sql or structured query language?

1128


How global temporary tables are represented and its scope?

948