SQL Sum
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, are not endorsed by FluffyCat.com, and may or may not be accurate. |
| Comment by Larry 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 Rate this Comment |
Hello,
|
| Sign In |
| to add your own comment |