I’m new in mysql and I’m currently having an issue with a query. I need to get an average duration for each activity each day within a week. The date format is like: ‘2000-01-01 01:01:01’, but I want to get rid of the 01:01:01 thing and only care about the date. How do I do that?
The table is something like this:
record_id int(10) NOT NULL,
activity_id varchar(100) NOT NULL,
start_time datetime NOT NUll,
end_time datetime NOT NULL,
duration int(10) NOT NULL;
Thanks.
You could do something like the following