How to calculate a person’s age in Oracle SQL?

Asked

Viewed 3,970 times

4

I need a sql command that returns the age of the person. I have the birth date of the person in the database, I need to calculate his age by SQL.

  • Guy didn’t understand how exactly you want it. Please explain more

  • 1

    I have the birth date of the person in the database, I need to calculate his age by SQL,

1 answer

8


Do

NVL(Floor(Months_Between(DtCalc,DtNasc)/12),0)

is a solution

I actually use a Function for this.

  • Motta, you can continue to answer my previous question about sequence of results

  • https://answall.com/questions/294163/tempo-corrido-calculo-datas this ? bag almost no php , but in general the best way to work with time is to reduce everything to the lowest unit (seconds , milliseconds etc.) operate the clacles and reconvert to the unit in question

Browser other questions tagged

You are not signed in. Login or sign up in order to post.