oracle sql日期比较

 
oracle sql日期比较:
在今天之前:
select*from up_date whereupdate< to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss')
select*from up_date whereupdate<= to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss')

在今天只后:
select*from up_date whereupdate> to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss')
select*from up_date whereupdate>= to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss')

精确时间:
select*from up_date whereupdate= to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss')

在某段时间内:
select*from up_date whereupdatebetween 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 whereupdate< to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss') andupdate> to_date('2007-07-07 00:00:00','yyyy-mm-dd hh24:mi:ss')
select*from up_date whereupdate<= to_date('2007-09-07 00:00:00','yyyy-mm-dd hh24:mi:ss') andupdate>= to_date('2007-07-07 00:00:00','yyyy-mm-dd hh24:mi:ss')
posted @ 2011-12-03 23:19  无双的小宝  阅读(1836)  评论(0编辑  收藏  举报