I want to add a new time-field to a an existing MySQL-table that is formated like this "MM:SS". The field is supposed to hold duration-data. What is the correct MySQL syntax to do this? Couldn't find anything that covers this on the MySQL-site.
A:
Why not just use an INTEGER and use it to store the number of seconds? When you want to use it, have your application(or possibly even the SQL query) convert the seconds into minutes and seconds.
Jesse Weigert
2008-12-24 01:27:38
A:
Two options:
1) Since it is duration have two DATETIME fields; start_time and end_time then just calculate the difference
2) Have one DATETIME field; start_time and one INTEGER field; length.
Andrew G. Johnson
2008-12-24 01:46:48
A:
MySQL has a TIME data type that is specifically meant for storing time durations.
Senseful
2008-12-24 15:38:55