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 the ‘fillfactor’?

920


How to move database physical files in ms sql server?

961


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

978


What do you understand by triggers?

862


Can you move the resources after pausing the node? : sql server database administration

1044


How to get nth highest salary from employee table.

1105


Can a database be shrunk to 0 bytes, if not, why?

1041


What is exclusive locks?

918


What is row-level compre?

944


Do you know what is similarity and difference between truncate and delete in sql?

961


When columns are added to existing tables, what do they initially contain?

978


What is data source in connection string?

852


How to add the custom code in Report?

118


Which tools are available to manage SQL Azure databases and servers?

113


What is BCNF? How is it better than 2NF & 3NF?

964