Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
For a table created using the following commands. State the SQL SELECT command to find

the 1 st and 2 nd highest salary earned by staff working in DEL or MUM

CREATE TABLE Employees (

ID int NOT NULL AUTO_INCREMENT,

Name varchar(100),

Sal decimal (10,2),

City char (3),

PRIMARY KEY (ID)

What I have tried:

Actually i tried by using Temp commands and Table.but not working.
Posted
Updated 1-Jun-16 5:24am
Comments
ZurdoDev 1-Jun-16 11:10am    
This is actually very simple. Just do it in English first

SELECT the top 2 salary from employees order by salary desc

There, I almost did it all for you.
Patrice T 1-Jun-16 20:05pm    
HomeWork ?

1 solution

SQL
SELECT TOP 2 Sal
    FROM Employees
    WHERE City = 'DEL' OR City = 'MUM'
    ORDER BY Sal DESC
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900