SELECT COUNT(*), DAY(timestamp), WEEK(timestamp), MONTH(timestamp), YEAR(timestamp) FROM transaction GROUP BY YEAR(timestamp), MONTH(timestamp), WEEK(timestamp), DAY(timestamp)