2
I have a table called tsc
, with the properties ID
and DataHoraOcorrencia
. I need to check the amount of ID
for DataHoraOcorrecia
.
SQL
SELECT
DataHoraOcorrencia as DataHora,
COUNT(tsc.ID) as Quantidade
FROM tsc
WHERE DataHoraOcorrencia BETWEEN '2017-07-01' AND '2017-07-30';
My problem is in the shape of DataHoraOcorrecia
, because if I make a between
date in the format aaaa-mm-dd
, it brings me with the hours, and need only by day. In case it groups by date and time and not just by date.
The entity DataHoraOcorrencia
is in format aaaa-mm-dd hh:ii:ss
.
In the case I still had to use GROUP BY. It worked, vlw.
– Jonathan de Toni