Question About SQL Query
- by Ameer
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.