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

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

WBOY
WBOYOriginal
2016-06-01 13:08:321014browse

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") 那么就会查到数据,

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

Statement:
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