赞
踩
SELECT id,
(UNIX_TIMESTAMP(DATE_FORMAT(end_time, '%Y-%m-%d %H:%i:%s')) -
UNIX_TIMESTAMP(DATE_FORMAT(start_time, '%Y-%m-%d %H:%i:%s')))/60/60 as diff_hours
FROM `your_table_name`
where start_time > 0
order by diff_hours desc;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。