sql - narrowing down rows added on a date in mysql -
i have following statement:
select count(*), firstadded db.table date(firstadded) between '2013-07-01' , '2013-07-10' group firstadded order count(*)
when execute it, returns data every time row has been added table.
1 | 2013-07-03 15:22:14 1 | 2013-07-03 15:23:14 1 | 2013-07-03 15:22:42 1 | 2013-07-03 15:45:29
i arrogate down amount of rows added daily (without m:s time, entire day). e.g.
345 | 2013-07-03 7482 | 2013-07-04 1237 | 2013-07-05
is possible?
this group by
query:
select date(firstadded), count(*) db.table group date(firstadded);
the function date()
converts datetime value date value, seems want.
your complete query be:
select count(*), date(firstadded) db.table date(firstadded) between '2013-07-01' , '2013-07-10' group date(firstadded) order count(*)
Comments
Post a Comment