zoukankan      html  css  js  c++  java
  • mysql日期加减问题

    有一个date列,我想修改下,
    让该列里每个日期都加上7天,怎么写代码? 


    update [表名] set  date=date_add(date, interval 7 day);



    SELECT * from game_user gu, card c WHERE gu.id = c.game_user_id and c.card_id = 326 and date_add(DATE_FORMAT(gu.enroll_time,'%Y-%m-%d'), interval gu.continue_login_days day) = DATE_FORMAT(gu.last_stamp,'%Y-%m-%d') and gu.login_days >= 7 ORDER BY gu.id

    -- SELECT * from game_user gu WHERE date_add(DATE_FORMAT(gu.enroll_time,'%Y-%m-%d'), interval gu.continue_login_days day) = DATE_FORMAT(gu.last_stamp,'%Y-%m-%d') and gu.login_days >= 7 ORDER BY gu.id

  • 相关阅读:
    IO模型
    协程
    线程
    进程
    网络编程
    模块二
    面向对象(二)
    面向对象(一)
    优化异常报错
    python 模块
  • 原文地址:https://www.cnblogs.com/zbl3033/p/3511134.html
Copyright © 2011-2022 走看看