PHP文章按日期(月日)SQL归档语句

前端之家收集整理的这篇文章主要介绍了PHP文章按日期(月日)SQL归档语句前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="59547" class="copybut" id="copybut59547" onclick="doCopy('code59547')"> 代码如下:

<div class="codebody" id="code59547">
select FROM_UNIXTIME(pubtime,'%Y-%m') as pubtime,count() as cnt from articles group by FROM_UNIXTIME(pubtime,'%Y-%m')

PHP文章按日期(日)sql归档
<div class="codetitle"><a style="CURSOR: pointer" data="51261" class="copybut" id="copybut51261" onclick="doCopy('code51261')"> 代码如下:
<div class="codebody" id="code51261">
select FROM_UNIXTIME(pubtime,'%Y-%m-%d') as pubtime,'%Y-%m-%d')

非时间戳日期格式归档(date_format格式化日期)
<div class="codetitle"><a style="CURSOR: pointer" data="29234" class="copybut" id="copybut29234" onclick="doCopy('code29234')"> 代码如下:
<div class="codebody" id="code29234">
select date_format(post_date,'%Y%m%d') as pubtime,count(
) as cnt from wp_posts where post_status='publish' group by date_format(post_date,'%Y%m%d') order by ID desc
select date_format(post_date,date_format(post_date,'%m 月 %d 日') as shijian,'%Y%m%d') order by ID desc limit 0,7

原文链接:https://www.f2er.com/php/26865.html
SQL归档

猜你在找的PHP相关文章