表名:1
字段:datetime(时间类型)
要求:把表1 里的datetime 字段 从2011-12-2 到2011-12-24的时间 改为 2012-2-2 到2012-2-24
求教呀……

解决方案 »

  1.   

    贴记录及要求结果出来看看
    update tt set f1=date_add(f1,INTERVAL 1 YEAR)
      

  2.   

    mysql> select date_add(now(),interval 3 month);
    +----------------------------------+
    | date_add(now(),interval 3 month) |
    +----------------------------------+
    | 2012-05-24 11:48:31              | 
    +----------------------------------+
    1 row in set (0.00 sec)mysql> 
      

  3.   

    update tb1 set col1=date_add(col1,interval 3 month) where col1 between '2011-12-2' and '2011-12-24';