mysql sql 进阶 in work

  

group_concat  

(UNIX_TIMESTAMP(oc.update_date)-UNIX_TIMESTAMP(oc.create_date))/3600

最近1年、1月、1周

SELECT * from oms_order_item_comment 
     where comment_time between date_sub(now(),interval 6 month) and now()  -- 半年
SELECT * from oms_order_item_comment 
     where comment_time between date_sub(now(),interval 1 week) and now()  -- 七天
SELECT * from oms_order_item_comment 
     where comment_time between date_sub(now(),interval 1 year) and now()  -- 一年

猜你喜欢

转载自blog.csdn.net/qq_24271537/article/details/115148127
今日推荐