Drupal 9: MySQL Query To Count The Number Of Articles Created Per Week

SELECT YEAR(FROM_UNIXTIME(created)) as year, MONTH(FROM_UNIXTIME(created)) as month, WEEK(FROM_UNIXTIME(created)) as week, count(1), group_concat(FROM_UNIXTIME(created))
FROM `node_field_data`
WHERE status = 1 and type = 'article'
GROUP BY YEAR(FROM_UNIXTIME(created)), MONTH(FROM_UNIXTIME(created)), WEEK(FROM_UNIXTIME(created))
ORDER BY YEAR(FROM_UNIXTIME(created)) DESC, MONTH(FROM_UNIXTIME(created)) DESC, WEEK(FROM_UNIXTIME(created)) DESC;

 

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
8 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.