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++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -