From: "Victoria Reznichenko" <[EMAIL PROTECTED]> > Why do you want to store the sum of columns? You can just sum them when > you retrieve data.
The database has got about 1 million records, and it gorws day by day The query I need returns lots of records, and calculating it while retrieving data is too expensive >Even if you want to store sum, you can sum values in INSERT > statement, can't you? You are right... The thing is that the data is inserted by a Perl script I made. The type of those fields is DateTime, and when I made the script I didn't find an operation for Dates that could do that... but now I know UNIX_TIMESTAMP() that suites perfect for what I want. I was about to do the calcs in my Perl script, but you're right, I can easily do it that way in the INSERT statement... Thanks a lot!!! Juan --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php