UPDATE users table with a calculated field for current_age
Posted: Sat Nov 09, 2013 8:16 am
I have a users table which has a birthdate field. I'm trying to figure out the syntax that would allow me to loop through the table and update another field name current_age. Using somekind of calculation based of the birthdate field.
I was thinking something like
UPDATE users
SET current_age=(birth_date)/(60*60*24*365.2421896)
in some kid of a loop if I need a loop.
I was thinking something like
UPDATE users
SET current_age=(birth_date)/(60*60*24*365.2421896)
in some kid of a loop if I need a loop.