业务需求,需要查询织梦某栏目近期发布文章的数量,写了两条sql语句,已经测试过分享给大家
织梦某栏目近7天发布文章的数量
Select count(id) as total From dede_archives where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= FROM_UNIXTIME(pubdate,'%Y-%m-%d') and typeid=171
织梦某栏目近30天发布文章的数量
Select count(id) as total From dede_archives where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= FROM_UNIXTIME(pubdate,'%Y-%m-%d') and typeid=171
稍后分享织梦查询当前周、当前月、当年发布文章的数量的sql语句