SQL> SELECT MAX(sal)
WHERE sal < (SELECT MAX(sal) FROM emp);
Look at the above query closely, sal < max(sal) returns all the salaries less than first max salary. Calculating maximum salary out of all the salaries less than the first maximum salary will return second maximum salary.
So use multiple subqueries to get nth max salary.
3. Using ROWNUM
ROWNUM is a psuedocolumn which retruns a number indicating the order in which …
Have you ever seen a online database which is free to use and free to practice.
Imagine you do not have to dowload GB's database software, install on your PC or laptop to practice SQL plus.
Application Express is a freeware application development framework based on Oracle Database. This was previously called HTML DB, long back while this was still HTML DB I had developed a Learning management system Oracle University which never went live on production. :-( but never stopped me from working on it.