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
How to attach adventureworkslt physical files to the server?
Explain rdbms?
What is the use of group by clause?
List layers of abstraction microsoft architectured to provide relational db through cloud platform ?
How you can get a list of all the table constraints in a database?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
How to create an index on a view?
What are the different types of columns types constraints in the sql server?
Explain the collation?
What are the advantages of sql stored procedure?
What are clustered and non-clustered index?
How to get nth highest salary from employee table.
What is a mutating table error and how can you get around it?
1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?
What is mssql?