Write a query to get all details of employee who has maximum
salary from employee table

Answer Posted / anil kumar prajapati

CREATE TABLE Employee_Test
(
Employee_ID INT,
Employee_name Varchar(100),
Employee_Salary Decimal (10,2)
);
INSERT INTO Employee_Test VALUES (1,'Anish',1000);
INSERT INTO Employee_Test VALUES (2,'Sushant',1200);
INSERT INTO Employee_Test VALUES (3,'Rakesh',1100);
INSERT INTO Employee_Test VALUES (4,'Manoj',1300);
INSERT INTO Employee_Test VALUES (5,'Amit',1400);
INSERT INTO Employee_Test VALUES (6,'Lokesh',1600);
INSERT INTO Employee_Test VALUES (7,'Maneneder',1400);
INSERT INTO Employee_Test VALUES (8,'Narendra',400);
INSERT INTO Employee_Test VALUES (9,'Kaushal',1900);
INSERT INTO Employee_Test VALUES (10,'Vikas',3400);
INSERT INTO Employee_Test VALUES (11,'Sudhir',800);
SELECT *FROM Employee_Test Emp1
WHERE ( n ) = (SELECT COUNT( DISTINCT (Emp2.Employee_Salary
) )
FROM Employee_Test Emp
WHERE Emp2.Employee_Salary >= Emp1.Employee_Salary
)

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the process of normalising?

592


Explain linked server in sql?

696


How to Insert multiple rows with a single insert statement?

549


How do I open a .db file?

484


What is reference section?

499






What is standby servers? Explain types of standby servers.

516


how to determine the service pack currently installed on sql server? : Sql server database administration

567


Give the query of getting last two records from the table in SQL SERVER?

543


What is a rollup clause?

547


Explain few examples of RDBMS?

615


What are the grouping functions?

532


Which operator do you use to return all of the rows from one query except rows are returned in a second query?

570


Does a full backup include transaction log?

485


How to remove duplicate rows from table?

603


Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security

582