Reputation: 685
I'm using MySQL and I currently have a VARCHAR column which stores times (in minutes and seconds) like "30:47" and "00:25" (25 seconds). How can I make it so that I can do operations like SUM() and AVG() on this column and get the result back.
So if I did AVG() on "00:35" and "00:45" I would get "00:40". Would I have to convert them to a decimal format first, then do the operation and then convert it back? Or is there a column type that would support these operations?
Upvotes: 2
Views: 245