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

Explain boyce and codd normal form(bcnf)?

621


Explain about local stored procedure?

601


Is sql server a database?

615


Explain contrast amongst grouped and non-bunched records?

606


What is the difference between count and distinct count?

544






Explain indexing and what are the advantages of it?

621


Does union all remove duplicates?

700


Explain about integration services of Microsoft SQL server?

679


What causes index fragmentation?

668


How to list all user names in a database?

669


What is the difference between implicit and explicit transaction?

642


Do you know what are the properties of the relational tables?

665


What are date and time data types in ms sql server?

615


What are trace files?

611


What are the different types of cursor?

688