Question About SQL Query
Posted
by Ameer
on Stack Overflow
See other posts from Stack Overflow
or by Ameer
Published on 2010-04-11T11:38:44Z
Indexed on
2010/04/11
11:43 UTC
Read the original article
Hit count: 246
I am using the below statement to generate age of a person in Oracle SQL and my question is below.
SELECT TO_NUMBER(TO_CHAR(CURRENT_DATE,'YYYY'))-TO_NUMBER(TO_CHAR(BIRTH_DATE,'YYYY')) FROM NAME WHERE NAME_ID =NAME_ID
This statement is only correct upto so far that I need a statement which could count months and even days in order to get the age.
© Stack Overflow or respective owner