Skip to content

Instantly share code, notes, and snippets.

@noahhendrix
Created November 19, 2010 20:34
Show Gist options
  • Save noahhendrix/707120 to your computer and use it in GitHub Desktop.
Save noahhendrix/707120 to your computer and use it in GitHub Desktop.
sum of difference of two datetime columns
SEC_TO_TIME(SUM(TIME_TO_SEC(TIMEDIFF(s.ended_at, s.started_at))))
@noahhendrix
Copy link
Author

Is this really the best way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment