This document provides an example of using a subquery to find the second largest salary in a sample salary_master table. It first finds the maximum salary, then selects the rows where the salary is less than the maximum. This returns the rows with the second highest salary. It then modifies the query to directly select the maximum salary rather than the rows, returning just the value of the second highest salary.
This document provides an example of using a subquery to find the second largest salary in a sample salary_master table. It first finds the maximum salary, then selects the rows where the salary is less than the maximum. This returns the rows with the second highest salary. It then modifies the query to directly select the maximum salary rather than the rows, returning just the value of the second highest salary.
This document provides an example of using a subquery to find the second largest salary in a sample salary_master table. It first finds the maximum salary, then selects the rows where the salary is less than the maximum. This returns the rows with the second highest salary. It then modifies the query to directly select the maximum salary rather than the rows, returning just the value of the second highest salary.