MySQL Forums
Forum List  »  Performance

Re: To store or calculate on the spot?
Posted by: newbie Shai
Date: August 11, 2011 02:21PM

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;

Options: ReplyQuote


Subject
Views
Written By
Posted
3312
July 23, 2011 09:15AM
1090
August 10, 2011 07:22PM
Re: To store or calculate on the spot?
1189
August 11, 2011 02:21PM
1152
August 11, 2011 07:52PM
1006
August 12, 2011 07:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.