tags:

views:

29

answers:

1

Hi, I'm writing a query in SQL in which i have to find the youngest senior person from a data given to me.

SSn    DOB
22   1950-2-2
21   1987-3-3
54   1954-4-7

The data is in the manner. And I need to find the age first so that I can write the condition of senior customers which is age >50. Since I dont have age parameter, please suggest me some ways to do it.

A: 
select * from people where year(now())-year(dob)>50 order by dob limit 1; 
cherouvim