eg for second largest using sub query
DESCRIPTION
read itTRANSCRIPT
Eg for second largest using sub querysalary_master: (Sample Data)
id name salary1 AAA 200002 BBB 180003 CCC 19000
SELECT MAX(salary) from salary_master
SELECT * from salary_master where salary < (SELECT MAX(salary) from salary_master)
Output:id name salary2 BBB 180003 CCC 19000Now will process the MAX(salary) instead of *we will get the output Second Largest Value
SELECT MAX(salary) from salary_master where salary < (SELECT MAX(salary) from salary_master)
Output:20000