Thursday, 9 February 2017

How would I find the second largest salary from the employee table?

Simple Approach ::
SELECT max(salary)
FROM emptable
WHERE salary < (SELECT max(salary)
                FROM emptable);
Alternate Approach ::
SELECT sal
FROM emp
ORDER BY sal DESC
LIMIT 1, 1;

2 comments:

  1. wow ! nice post Indian Cyber Army gives the best in the Cyber crime investigation. We have put our foot one-step forward launching an effective Summer Internship program.The Summer Internship 2018 registrations are open for 2nd batch starting from 2 July 2018. Our standard services of Cyber Crime Investigation are class apart owing to years of proficiency. We provide Advanced Cyber Security, Ethical Hacking, Digital Forensics, etc. trainings to keep India totally secure from the Cyber Offenders.

    ReplyDelete
  2. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site. The Information security community consists of experts from a diverse range of disciplines, experiences, and training. Indian Cyber Army has been dedicated in fighting cyber crime, striving to maintain law and order in cyberspace so as to ensure that everyone remains digitally safe. Join with to create awareness, handle the project and make the career in this field.

    ReplyDelete