mysql - Set date as three days before -


i wondering if looks right way things:

update table set `date2` = date_sub(`date1`,interval -2 day); 

i set date on date2 column 2 days before date on date1 column.

thanks insight!

i seldom use date_sub() or date_add() functions, because it's more clear use date arithmetic.

update table set `date2` = `date1` - interval 2 day; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -