Home > Database > Mysql Tutorial > Mysql在字符串类型的日期上加上10分钟并和现在的日期做比较_MySQL

Mysql在字符串类型的日期上加上10分钟并和现在的日期做比较_MySQL

WBOY
Release: 2016-06-01 13:08:32
Original
1133 people have browsed it

SELECT id FROM tran WHERE state = 'F' AND TIMESTAMPDIFF(SECOND,DATE_ADD(create_date,INTERVAL 10 DAY_MINUTE),"2014-06-18 10:30:29")>0





如果create_date加10分钟大于等于当前的时间("2014-06-18 10:30:29") 那么就会查到数据,

如果小于那么就查不到数据

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template