0
How I can group data from MYSQL by date, and in BD the field and Timestamp 2019-04-18 08:01:10
$sql = "SELECT * FROM tbl_reclamacoes GROUP BY data_reclamacoes ORDER BY data_reclamacoes ASC";
0
How I can group data from MYSQL by date, and in BD the field and Timestamp 2019-04-18 08:01:10
$sql = "SELECT * FROM tbl_reclamacoes GROUP BY data_reclamacoes ORDER BY data_reclamacoes ASC";
2
Use the function Date
, as follows:
$sql = "SELECT * FROM tbl_reclamacoes GROUP BY DATE(data_reclamacoes) ORDER BY data_reclamacoes ASC";
It will bring only the date at the time of grouping.
0
Considering the idea of bringing the occurrences on the same date, ignoring the time, I believe that the query should stay like this:
SELECT *
FROM tbl_reclamacoes
WHERE DATE_FORMAT(data_reclamacoes, "%M %d %Y") = DATE_FORMAT(data_pesquisada, "%M %d %Y")
ORDER BY data_reclamacoes ASC
whereas the data_pesquisada
shall be that of the day to be consulted.
Browser other questions tagged php mysql
You are not signed in. Login or sign up in order to post.
does not make much sense this query, what you want to group (which fields should be listed)?
– rLinhares
In the bank I have several dates on the same day, but at different times, If I give a GROUP BY on the date, it will only show me those that are the same, with the same date and time, in case I need to group all of the same date, ignoring the time
– Marcos Paulo