SELECT t1.case_id, REPLACE(REPLACE(REPLACE(t1.data_time,'-',''), ':', ''), ' ', '') AS radra_data_time,REPLACE(REPLACE(REPLACE(CONCAT_WS(':', DATE_FORMAT(t1.data_time, '%Y-%m-%d %H'),LPAD(FLOOR(MINUTE(t1.data_time) / 6) * 6, 2, '00'),"00"),'-',''), ':', ''), ' ', '') as light_data_time
FROM `tsw_case_timelist` t1
LEFT JOIN `light_case_timelist` t2
ON t1.case_id = t2.case_id AND CONCAT_WS(':', DATE_FORMAT(t1.data_time, '%Y-%m-%d %H'),LPAD(FLOOR(MINUTE(t1.data_time) / 6) * 6, 2, '00'),"00") = t2.data_time
WHERE t2.case_id IS NULL;
mysql中将时间的分钟位除6取证再×6
最新推荐文章于 2024-08-21 23:28:12 发布