SELECT COUNT(*) AS contador, hora_efetivada FROM minha_tabela WHERE status=2
I have a counter that returns the total value of status 2 in the database, but in my column named hora_efetivada
there are several times. How do I make my select
return the first time and the last time?
For example:
|status| hora_efetivada
| 2 | 13:10
| 2 | 13:12
| 2 | 12:01
| 2 | 08:03
| 2 | 18:03
| 2 | 13:03
My SELECT would return COUNT = 6
and both times ( 08:03
and 13:13
).
Will I have to implement it in a different way?