None of the queries are suitable for this. You get MAX (salary) from records with a salary less than MAX (salary) for all records. In other words, the second largest salary. The way to do this is:
SELECT salary FROM table1 ORDER BY salary DESC LIMIT 1,1
If you really want max, just do
SELECT MAX(salary) FROM table1
. , , , , .