mysql 时间差问题集锦

mysql 时间差问题集锦_第1张图片

SELECT * from grouptoadd where taskid = '103244';

select datediff(max(spreadtime),min(createtime)) from grouptoadd where taskid = '103244';

-- 【mysql】时间差
SELECT TIMESTAMPDIFF(DAY, createtime ,spreadtime) AS `DAY` from grouptoadd where taskid = '103244';

SELECT TIMESTAMPDIFF(HOUR, createtime ,spreadtime) AS `HOUR` from grouptoadd where taskid = '103244';

SELECT TIMESTAMPDIFF(MINUTE, createtime ,spreadtime) AS `MINUTE` from grouptoadd where taskid = '103244';

SELECT TIMESTAMPDIFF(SECOND, createtime ,spreadtime) AS `Second` from grouptoadd where taskid = '103244';

mysql 时间差问题集锦_第2张图片

mysql 时间差问题集锦_第3张图片mysql 时间差问题集锦_第4张图片mysql 时间差问题集锦_第5张图片mysql 时间差问题集锦_第6张图片

你可能感兴趣的:(mysql 时间差问题集锦)