M
M
My joy2017-01-12 22:35:01
PHP
My joy, 2017-01-12 22:35:01

Grouping values ​​by days if the field is in timestamp format?

Good evening comrade friends.
There are collections in monge in which fields with the date of addition in the timestamp format:
date_add: 1484249082
how do I group them to get a selection ala:

{
date: 2017-01-01
count:3
},
{
date: 2017-01-02
count:4
},
{
date: 2017-01-03
count:0
},
...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danil Sysoev, 2017-01-12
@YoungOldMan

SELECT ... GROUP BY DATE(`datetimecolumn`)
From here took
Not it? Or basically json should be the view?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question