oracle sql date not later than today

后端 未结 2 1683
梦毁少年i
梦毁少年i 2021-02-03 21:21

I need to display some data if it\'s a - new data - updated data let\'s say, I will be basing these data from a publishdate column and updated column where publishdate and

2条回答
  •  粉色の甜心
    2021-02-03 22:10

    For last 24 hours:

    Where publish_date >= sysdate -1
    

    or anytime today (midnight forward)

    where publish_date >= trunc(sysdate)
    

    If this is a big table, I assume you have an index on publish_date. If you use trunc(publish_date), it may not be able to use the index (untested, but run an explain plan to be sure).

提交回复
热议问题