oracle和mysql中如何编写查A表中occurtime字段时间在2013-9-18 00:00:00到2013-9-18 01:00:00的数据的sql

如题所述

第1个回答  2013-09-18
oracle :
select * from A where occurtime >= to_date('2013-9-18 00:00:00','yyyy-MM-dd hh:mm:ss')
and occurtime <= to_date('2013-9-18 01:00:00','yyyy-MM-dd hh:mm:ss')
第2个回答  2013-09-18
select * from table where occurtime between unix_timestamp('2013-9-18 00:00:00') and unix_timestamp('2013-9-18 01:00:00');

第3个回答  2013-09-18
首先有个疑问,没有看懂你的occurtime字段内容有什么规律,是时间吗?如果方便,请举例解释一下。
相似回答
大家正在搜