Dear Mates, Please click the ads to support us.
Tutorial

Second highest salary using SQL

Kailash Singh Mar 07, 2023 3149 Views
Kailash Singh

Second highest salary using SQL Share

Published Mar 07, 2023 by Kailash Singh 0 Comments 3149 Views

In this tutorial, we are going to teach you, how to find Second highest salary using SQL.

 

For Example: You have a salary table and you have five users records in salary table and you need to find second highest salary in this table.

Demo Table: 

Second highest salary using SQL

 

Sql Query: 

SELECT MAX(emp_salary) 
FROM `salary` 
WHERE emp_salary 
NOT IN (SELECT MAX(emp_salary) FROM salary);

 

Result:

Comments 0


SEARCH POST HERE


Support Us

Subscribe My YouTube Channel

Join Our Telegram Channel & Support Eachother

CATEGORIES

INTERVIEW QUESTIONS

PROJECT SOURCE CODE






POPULAR POSTS