Re: To store or calculate on the spot?
Dear Rick,
Thank you for the link and the explanation of the int(2) and int(999) because I always get worried wat to set there. So this all fall under the int range right. On another note remember you suggested this query for my calculation. Beside summing directly from another table I also need to do some additional calculation like for instance if the driverLicense is about not due yet on that day give one point to total sum too. Any idea how to have many more additional calculation embedded.
INSERT INTO SummaryTable
SELECT datetime,b,c COUNT(*), SUM(xx), ...
FROM MainTable
WHERE datetime >= CURRENT_DATE() - INTERVAL 1 DAY
AND datetime < CURRENT_DATE()
GROUP BY LEFT(10, datetime, 10),b,c;