Tag Archives: select second higest using php

Select second higest value from a database table.

Example: my table ‘salary_table’ with name and salary fields id name salary 1 vasanthan 300 2 sunil 300 3 nasar 200 4 raja 100 5 Raina 400 6 Haier 600 7 shaji 400 for getting second highest salary use the following queries SELECT MAX( salary ) FROM salary_table WHERE salary NOT IN (SELECT MAX( salary… Read More »