dongshie8450 2018-03-26 17:55
浏览 179
已采纳

更新MySQL查询以在7天前移动数据

I have this website programmed with PHP and of course using MySQL as the Database Tool. I need to move my data one back back or ahead.

The first image shows the set up I have right now. Original Image

And by clicking on the PUSH 1 WEEK link on the top right corner, the second image show what I want to accomplish. You can see that the information/data moved one week ahead.

I try to accomplish this

Third image shows my table scheme

Table Scheme

I would like to get help on how to word my UPDATE or what are the guidelines to accomplish this.

Thanks

  • 写回答

1条回答 默认 最新

  • doutuohan6606 2018-03-26 18:17
    关注

    Your task can be archived with a simple SQL statement (Source):

    UPDATE table 
    SET `date` = DATE_ADD(`date` , INTERVAL 7 DAY)
    WHERE `id` = 161;
    

    This adds 7 days to all entries that match the WHERE condition.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器