首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

oracle sql日期比较

2012-06-30 
oracle sql日期比较 .在某某日期之前:select * from tableName where dateColm to_date(2012-06-14,

oracle sql日期比较 .

在某某日期之前:

select * from tableName where dateColm <= to_date('2012-06-14','yyyy-mm-dd');select * from tableName where dateColm <= to_date('2012-06-14 00:00','yyyy-mm-dd hh24:mi');select * from tableName where dateColm <= to_date('2012-06-14 00:00:00','yyyy-mm-dd hh24:mi:ss');

?在某某日期之后:

select * from tableName where dateColm >= to_date('2012-06-14','yyyy-mm-dd');

?

等于某个日期(可精确到时分秒):

select * from tableName where dateColm = to_date('2012-06-14','yyyy-mm-dd');select * from tableName where dateColm = to_date('2012-06-14 00:00','yyyy-mm-dd hh24:mi');select * from tableName where dateColm = to_date('2012-06-14 00:00:00','yyyy-mm-dd hh24:mi:ss');

?在某个时间段范围内:

<pre name="code">select * from tableName where dateColm between to_date('2012-06-14 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2012-06-24 00:00:00','yyyy-mm-dd hh24:mi:ss');select * from tableName where dateColm >= to_date('2012-06-14 00:00:00','yyyy-mm-dd hh24:mi:ss') and dateColm <= to_date('2012-06-24 00:00:00','yyyy-mm-dd hh24:mi:ss');

?

热点排行