MySQL Count rows by date timestamp

From D3xt3r01.tk
Revision as of 02:39, 26 August 2009 by Admin (talk | contribs) (New page: ==WHY== I wanted to see a history of how many rows were inserted in a table by date. In that table I have a timestamp type column. ==QUERY== The `date` column is the one that has the tim...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

WHY

I wanted to see a history of how many rows were inserted in a table by date. In that table I have a timestamp type column.

QUERY

The `date` column is the one that has the timestamp type.

SELECT date(`date`), count(*) FROM `table` GROUP BY date(`date`);