SQL Sum() Example
Select Sum(Film_Length) From Film_Table Where Film_Title in ("Big Daddy", "The Waterboy", "The Wedding Singer");
345 (in minutes, as length is just a numeric)
|Comments Comments are left by visitors to FluffyCat.com and may or may not be accurate.|
|Comment by Larry on 2006-12-12 Rate this Comment|
Working with time and dates can be tricky and is usually database specific or even database version specific. I found this example in the online MySQL documentation. Essentially, the summing is done for the time using base 100 (like most sums) and is then converted back into time using the SEC_TO_TIME function.
|Comment by archive on 2006-12-12 Rate this Comment|
|Sign in to comment on SQL Sum.|