I have a table psttodo-uit with some fields like Hostess Code, Datum Bezoek 1, PA, PB, PG, GoedkeuringDoorNew, Blanco, .. .
Now I would like to select all the fields where Hostess Code is equal to ... . I want an overview like this:
1 march | info info info
2 march | info info info
But in my table I have :
2014-04-03 11:32:18
2014-04-03 11:22:16
2014-04-02 16:05:22
2014-04-02 15:40:43
2014-04-02 15:17:41
So I would like to select for each day and make a count of the other fields like count(PA = 1). Can I do this in one SQL Query?
SELECT day(`Datum Bozek`),month(`Datum bozek`),year(`Datum bozek`),count(*) WHERE `Hostess Code`='your hostess code'` group by day(`Datum Bozek`),month(`Datum bozek`),year(`Datum bozek`). for moreinfos see dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html and w3resource.com/mysql/aggregate-functions-and-grouping/…