首页 >数据库 >mysql教程 >mysql日期比较语句_MySQL

mysql日期比较语句_MySQL

WBOY
WBOY原创
2016-06-01 13:40:281150浏览

bitsCN.com
mysql日期比较语句 select * from student where '2012-02-27 00:00:00' created_date select * from student where UNIX_TIMESTAMP('2012-02-27 00:00:00') UNIX_TIMESTAMP(created_date);   SELECT * FROM student WHERE (UNIX_TIMESTAMP(created_date) - UNIX_TIMESTAMP('2012-02-26 00:00:00') ) >= 0 AND (UNIX_TIMESTAMP(created_date) - UNIX_TIMESTAMP('2012-02-29 00:00:00') )
有了这个函数,就可以很自然地把时间比较转换为一个无符号整数的比较。例如,判断一个时间是否在一个区间内unix_timestamp( time ) between unix_timestamp( 'start ') and unix_timestamp( 'end' ) bitsCN.com

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn