我有这个查询,我需要找出两种时间格式之间的区别。所以我需要添加一个子句,即:
WHERE end-date - start-date should be between 01:00:00 and 05:00:00
你能帮我把它变成一个mysql语句吗?谢谢
$data = mysql_query( "select r.`time`, r.`epos_id`,r.`basket_value`, r.`date`,re.`location`,i.`user_id`,i.`mobile_number`,
i.`time`, i.`rbpos_id`, i.`date`
from retailer r
join rbpos_epos re on r.epos_id = re.epos_id
join imovo i on i.rbpos_id = re.rbpos_id
WHERE TIMEDIFF(i.`time`, r.`time`)<'01:05:00'
and r.`time` < i.`time`
and r.`date` = i.`date`;
")