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 / ganesh

with cte as
(
select *,row_number() over(order by salary desc) as rowno
from empsal
)
select * from emp e join cte c
on e.id=c.id
where c.rowno=1

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is outer join in sql server joins?

1130


What is the most common trace flags used with sql server?

1054


What are cursors in ms sql server?

1187


What is ms sql server service broker?

1000


How to create an index on a view?

1077


How to stop a loop early with break statements in ms sql server?

1026


Difference between report and query parameter. Why do we need different type of parameter?

969


What are a scheduled jobs or what is a scheduled tasks?

903


You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

1040


what is spatial nonclustered index

996


Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?

990


What is the difference between sdf and mdf?

1308


Can we insert data into a view?

1143


What sql server means?

972


What are the approximate numeric data types?

947