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
What is log shipping?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What is the template in sql?
what are the different types of SSRS reports?
What is the difference between resultset and resultsetmetadata?
what are the Prerequisites for Replication?
How to change the system date and time from SQL Plus Terminal ?
what's the difference between a primary key and a unique key? : Sql server database administration
What do you understand by replication in sql server? Mention the different types of replication in sql server.
What is the use of RDBMS?
What is a non equi join?
What is reportserver and reportservertempdb ?
How to manipulate data from one table to another table ?
What is the sql server agent?
Explain few of the new features of sql server 2008 management studio