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
What is outer join in sql server joins?
What is the most common trace flags used with sql server?
What are cursors in ms sql server?
What is ms sql server service broker?
How to create an index on a view?
How to stop a loop early with break statements in ms sql server?
Difference between report and query parameter. Why do we need different type of parameter?
What are a scheduled jobs or what is a scheduled tasks?
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?
what is spatial nonclustered index
Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?
What is the difference between sdf and mdf?
Can we insert data into a view?
What sql server means?
What are the approximate numeric data types?