hCentive Interview Question: Given a table containing Empl... | Glassdoor.co.in

Interview Question

Lead Consultant Interview Gurgaon, Haryana

Given a table containing Employee names & Age, give a SQL

  Select query to find out the list of 2nd oldest people.
Tags:
sql
Answer

Interview Answer

3 Answers

0

Can use a combination of MAX(age) inside an inner query

Interview Candidate on 29-Jun-2012
1

need an inner join:
like select * from table T1 where
(select count(*) from table
T2 where T2.age

Anonymous on 09-Jul-2012
0

select max(p.age) from persons p
where p.age < (select max(p1.age) from persons p1 where p.age = p1.age)

Nikhil on 08-Apr-2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.