Proc Id Start_time end_time Status
111 7/4/2017 9:08:43 AM 7/4/2017 9:35:54 AM Success
我想找到star_time和end_time之间的持续时间(以分钟为单位)。 请帮我怎么做?
答案 0 :(得分:0)
你可以试试这个......
SELECT TIMESTAMPDIFF(MINUTE,tmp.start_time,tmp.end_time) FROM (select start_time,end_time from table_name where id=?) as tmp;
答案 1 :(得分:0)
SELECT TIMESTAMPDIFF(MINUTE,STR_TO_DATE(Start_time,'%d/%m/%Y %H:%i:%s),STR_TO_DATE(end_time,'%d/%m/%Y %H:%i:%s)) from TABLENAME;
尝试以上查询。希望这对您有帮助。