SELECT * FROM t_communication_log where record_number>'0' and
event_time> UNIX_TIMESTAMP('2003-07-28 00:00:00') and
event_time< UNIX_TIMESTAMP('2003-07-29 00:00:00') ;
event_time> UNIX_TIMESTAMP('2003-07-28 00:00:00') and
event_time< UNIX_TIMESTAMP('2003-07-29 00:00:00') ;
event_time> UNIX_TIMESTAMP('2003-07-28 00:00:00') and
event_time< UNIX_TIMESTAMP('2003-07-28 23:59:59') ;
WHERE record_number>'0'
AND
TO_DAYS(event_time) >= TO_DAYS('2003-07-28')
AND
TO_DAYS(event_time) < TO_DAYS('2003-07-29')
如果不行就加上FROM_UNIXTIME(even_time)
SELECT * FROM t_communication_log where record_number>'0' and
UNIX_TIMESTAMP(event_time) >= UNIX_TIMESTAMP('2003-07-28 00:00:00') and
UNIX_TIMESTAMP(event_time) <= UNIX_TIMESTAMP('2003-07-28 23:59:59') ;
SELECT * FROM t_communication_log where record_number>'0' and
event_time> '2003-07-28 00:00:00' and
event_time< '2003-07-28 23:59:59' ;
它就是表示28号0点0分0秒;我改试了,把那个字段改成datatime类型, 然后:
SELECT * FROM t_communication_log where record_number>'0' and
event_time> '2003-07-28 00:00:00'and
event_time< '2003-07-28 23:59:59' ;
就成功了,哈哈,结贴!