sql - Automatically update people's ages in sqlite -


how automatically update people's age in sqlite database? have put dateofbirth column, , created column called today supposed display current date putting set today = date('now') function. made created age column calculates age subtracting birth dates current date (today-date of birth), seems job. but, problem today isn't automatically updated, do? in advance, cheers

how automatically update people's age in sqlite database?

you don't need since age computed column , while displaying data can calculate age , show accordingly. since have dob stored need teh difference currentday - dob age.

use update statement update today column

update your_table set today = date('now') 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -