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
What is partition index in sql server?
What is the Control Flow in SSIS
How many levels of sp nesting is possible?
Why should one not prefix user stored procedures with ‘sp_’?
Can an entity have two primary keys?
How to create a view with data from multiple tables?
What is the use of =,==,=== operators?
Explain transaction server distributed transaction?
How do you delete duplicate rows in sql server?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
What are the requirements for sql server 2016?
how to control the amount of free space in your index pages? : Sql server database administration
What command is used to create a database in the sql server and how?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
How to achieve Paging of records in SQL SERVER?