1
CREATE TABLE `articles_entities` (
  `id` CHAR(36) NOT NULL,
....
  `created` DATETIME DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `created` (`created`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8;

I am trying to create a query that gives me the count of records by day.. e.g

Day 1: 23 
Day 2: 343 
etc...

Please note the output is not the exact format I want, just a display of what data I want.

1 Answer 1

2

While writing the question I realised just how easy this is....

SELECT COUNT(*), DATE_FORMAT(created, '%Y%m%d') AS testgroup FROM articles_entities GROUP BY testgroup;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.