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...

two tables are there.1st table EMP has two columns ID and name and contains data 1,A
2,B
3,C
2nd table EmpSal has 2 columns ID and Salary
Contains data -1,1000
2,5000
3,3000

Find name of employee having maximum salary ?

Answer Posted / kanagavel

with cte
as
(
SELECT name,max(sal) as 'sal'
from emp1 inner join empsal
where emp1.id=empsal.id
group by name
)
select top 1 *
from cte
order by sal desc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is log shipping?

998


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

1254


What is the template in sql?

1029


what are the different types of SSRS reports?

160


What is the difference between resultset and resultsetmetadata?

1031


what are the Prerequisites for Replication?

11443


How to change the system date and time from SQL Plus Terminal ?

1273


what's the difference between a primary key and a unique key? : Sql server database administration

991


What do you understand by replication in sql server? Mention the different types of replication in sql server.

994


What is the use of RDBMS?

1055


What is a non equi join?

1023


What is reportserver and reportservertempdb ?

160


How to manipulate data from one table to another table ?

1021


What is the sql server agent?

1146


Explain few of the new features of sql server 2008 management studio

979