#当天内数据
SELECT
p.id,
p.queue_id queueId,
p.user_id userId,
p.user_name userName,
p.create_id,
p.create_date,
DateDiff(now(),p.create_date) as mydat
FROM
pub_queue_user_t p
where
DateDiff(now(),p.create_date)=0
timestampdiff(type,时间1,时间2)返回的是两个时间差 type返回类型frac_second 毫秒(低版本不支持,用second,再除于1000)second minute hour day week month quarter year
#当天内数据
SELECT
p.id,
p.queue_id queueId,
p.user_id userId,
p.user_name userName,
p.create_id,
p.create_date,
timestampdiff(day,p.create_date,now()) as mydat
FROM
pub_queue_user_t p
where
timestampdiff(day,p.create_date,now())=0
timeDiff(时间1,时间2) 返回的是两个时间差(差值时:分:秒)
#当天内数据
SELECT
p.id,
p.queue_id queueId,
p.user_id userId,
p.user_name userName,
p.create_id,
p.create_date,
timeDiff(now(),p.create_date) as mydat
FROM
pub_queue_user_t p
where
timeDiff(now(),p.create_date)=0