×
×
Second highest salary using SQL
Second highest salary using SQL
Published Mar 07,2023 by Kailash Singh
0 Comment 1377 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:
Sql Query:
SELECT MAX(emp_salary)
FROM `salary`
WHERE emp_salary
NOT IN (SELECT MAX(emp_salary) FROM salary);
Result:
Comments ( 0 )
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date
Copyright 2018 - 2024 Elevenstech Web Tutorials All rights reserved.