What is the SQL query to get the third highest salary of an employee from employee table

0 votes
Hi!!

Can someone tell me how to write a SQL query to get the third highest salary of an employee from employee_table?
Sep 27, 2018 in Database by DataKing99
• 8,240 points
7,056 views

try this

SELECT TOP 3 salary

FROM(

SELECT TOP 1 salary

FROM Employee_Table

ORDER BY salary DESC) AS emp

ORDER BY salary ASC;

1 answer to this question.

0 votes

You can try out something like this:

SELECT TOP 1 salary

FROM(

SELECT TOP 3 salary

FROM employee_table

ORDER BY salary DESC) AS emp

ORDER BY salary ASC;
answered Sep 27, 2018 by Sahiti
• 6,360 points
This is correct

SELECT TOP 3 salary

FROM(

SELECT TOP 1 salary

FROM Employee_Table

ORDER BY salary DESC) AS emp

ORDER BY salary ASC;

Related Questions In Database

0 votes
1 answer
0 votes
1 answer

What is the best way to fetch data from table?

Hey Shraddha, I understand your doubts about fetching ...READ MORE

answered May 25, 2019 in Database by sampriti
• 1,120 points
938 views
0 votes
1 answer

What is the definition of cardinality in SQL?

Cardinality is defined as the "number of ...READ MORE

answered Feb 15 in Database by Neha
• 6,260 points
84 views
0 votes
0 answers

What is the definition of cardinality in SQL?

My book definition of Database Systems does ...READ MORE

Feb 18 in Database by Neha
• 6,260 points
75 views
0 votes
1 answer

SQL query to find third highest salary in company

The easiest way to work this out ...READ MORE

answered Feb 21 in Database by Neha
• 6,260 points
895 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by Parth
• 4,630 points
851 views
0 votes
1 answer

Is SELECT * harmful in Database?

There are really three major reasons: Inefficiency in ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,240 points
347 views
0 votes
1 answer

Difference between single and double quotes in SQL

Single quotes are used to indicate the ...READ MORE

answered Sep 11, 2018 in Database by CodingByHeart77
• 3,720 points
13,209 views
0 votes
2 answers

What are the ways to get the count of records in a table

With the help of the SQL count ...READ MORE

answered Aug 20, 2020 in Database by Okugbe
• 280 points
1,838 views
0 votes
2 answers

Write a SQL query to find the names of employees that begin with ‘S’

Select ename From emp Where ename like"s%"; READ MORE

answered Oct 7, 2021 in Database by anonymous
12,199 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP