I have table data with columns start and End. The column start and end have the date and time in this format: 2012-04-06 07:43:05 . I need to do this: End – Start (for each row obviously) and add up all the resulting time. [ only time field subtraction is enough as the date is probably the same for both start and end]
Any easy way to do this?
I would probably approach this by converting the dates to unix timestamp using UNIX_TIMESTAMP() in MySQL, then it is easier to do calculations like these you want.
Something like:
This will get you a sum of all the differences in seconds.