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
Explain the flow of creating a cube? : sql server analysis services, ssas
What is the function of sql server agent windows service?
What are relationships and mention different types of relationships in the dbms
When I run the sql server 2000 setup, it just hangs. What do I do?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?
How to view existing indexes on an given table using sp_help?
Is ssrs support other database except ms sql server?
What are the restrictions applicable while creating views? : SQL Server Architecture
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
How to verify a login name with sqlcmd tool?
What are the character string functions supported by sql server 2005?
What are sql servers used for?
How to provide login information for a new odbc dsn?
What are the restrictions that views have to follow? : SQL Server Architecture
What is a matrix in ssrs?