mysql中取得当前时间之前半小时的数据,sql应该怎么写

select * from 表名 where checktime > date_add(now(),interval 30 minute)
mysql中取得当前时间之前半小时的数据,sql应该怎么写
select * from 表 where `checktime` < ???

你先举个例子 checktime中的具体字段值 要不然怎么比较?2009-11-30
select * from 表名 where checktime > date_add(now(),interval 30 minute)2009-11-30
select * from table1(你要查的表) where datediff(mi,checktime,getdate()) >302009-11-30
mengvlog 阅读 141 次 更新于 2025-12-18 22:18:37 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部