employer cover photo
employer logo
employer logo

Tata Consultancy Services

Part of Tata Group

Engaged employer

Tata Consultancy Services interview question

Write a query to find second highest salary.

Interview Answers

Anonymous

15 Nov 2017

select max(salary) from tablename where salary<(select max(salary) from tablename);

Anonymous

15 Nov 2017

select max(salary) from tablename where salary < (select max(salary) from tablename);

Anonymous

15 Nov 2017

select max(salary) from tablename where salary (is less than)(<) (select max(salary) from tablename);