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

Why we use trigger in sql server with example?

517


What is a partitioned view?

578


Can you type more than one query in the query editor screen at the same time?

584


what exactly sql injuction.how to overcome.....

2049


What do you mean by normalisation?

513






Can I run multiple instances of sql server 2000 at the same time on one computer?

610


How do I schedule a sql server profiler trace?

547


What are the recovery models for a database?

627


Do you know what is fill factor and pad index?

571


What is the difference between function and stored procedure in sql server?

494


Mention the differences between substr and charindex in sql server.

530


How do I install only the client tools of sql server 2000?

560


Which tools are available to manage SQL Azure databases and servers?

93


What number sorts of privileges are accessible in sql?

600


What are Row versions of DataRow?

618