select TIMESTAMPDIFF(SECOND,startTime,endTime) as timeDifference from myTable ;

This will return the difference in seconds between the startTime and endTime in timeDifference. You can use other units other than SECOND. You may replace SECOND with MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER YEAR or FRAC_SECOND.

Leave a Reply

Your email address will not be published. Required fields are marked *