Home > Backend Development > PHP Tutorial > PHP article by date (month day) SQL archive statement_PHP tutorial

PHP article by date (month day) SQL archive statement_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:14:21
Original
810 people have browsed it

Copy code The code is as follows:

select FROM_UNIXTIME(pubtime, '%Y-%m') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m')

PHP articles group by date (day) SQL archive
Copy code The code is as follows:

select FROM_UNIXTIME(pubtime, '%Y-%m-%d') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m-%d')

Non-timestamp date format archive (date_format formatted date)
Copy code The code is as follows:

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`,'%Y%m%d') as pubtime,date_format(`post_date`, '%m month %d day') as shijian,count(*) as cnt from wp_posts where `post_status`='publish' group by date_format(`post_date`,'%Y%m%d') order by `ID` desc limit 0,7

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326264.htmlTechArticleCopy the code The code is as follows: select FROM_UNIXTIME(pubtime, '%Y-%m') as pubtime, count(* ) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m') PHP articles are returned by date (day) SQL...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template