Oracle 日期比较

oracle sql日期比较:
在今天之前:

<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> select   *   from  up_date  where   update   <  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )
select   *   from  up_date  where   update   <=  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )


在今天只后:

<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> select   *   from  up_date  where   update   >  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )
select   *   from  up_date  where   update   >=  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )


精确时间:

<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> select   *   from  up_date  where   update   =  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )


在某段时间内:

<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--> select   *   from  up_date  where   update   between  to_date( ' 2007-07-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' and  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )
select   *   from  up_date  where   update   <  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' and   update   >  to_date( ' 2007-07-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )
select   *   from  up_date  where   update   <=  to_date( ' 2007-09-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' and   update   >=  to_date( ' 2007-07-07 00:00:00 ' , ' yyyy-mm-dd hh24:mi:ss ' )

你可能感兴趣的:(oracle)