sql如何查询离现在10分钟以内的数据?
------解决方案--------------------
select * from table where datediff(mi,col,getdate())=10
------解决方案--------------------
- SQL code
SELECT * FROM tablename WHERE 日期字段 > DATEADD(MINUTE,-10,GETDATE())
------解决方案--------------------
datediff(mi,time1,time2)<=10
------解决方案--------------------
- SQL code
SELECT * FROM tablename WHERE datediff(mi,时间字段,getdate())<=10