我有一个查询,我必须以分钟计算时差,但我也需要秒。那么,我可以在以下查询中使用6.10说明6分10秒吗?或者有没有其他的陈述?
查询:
select distinct(users) , avisitedDate from visitSearchEngine vs
WHERE vs.users!=' '
AND vs.status='0'
AND vs.hitType='googleIdentified'
AND vs.avisitedDate>'2012-12-06'
AND ((TIME_TO_SEC(TIMEDIFF(NOW(),vs.avisitedDate)))/60)>=5
AND ((TIME_TO_SEC(TIMEDIFF(NOW(),vs.avisitedDate)))/60)<6.10
请给我建议!
谢谢,
答案 0 :(得分:1)
select distinct(users) , avisitedDate from visitSearchEngine vs
WHERE vs.users!=' '
AND vs.status='0'
AND vs.hitType='googleIdentified'
AND vs.avisitedDate>'2012-12-06'
AND TIMEDIFF(NOW(),vs.avisitedDate) >= '00:05:00'
AND TIMEDIFF(NOW(),vs.avisitedDate) < '00:06:10'