oracle sql date不迟于今天 [英] oracle sql date not later than today
问题描述
如果是 - 新数据 -更新数据 假设,我将基于publishdate列和update列中的这些数据,其中publishdate和updatedate都是时间戳? .那么如果是新日期,如何计算日期呢?
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 updateddate are both timestamps ? . so how to compute the date if it's a new one ?
推荐答案
最近24小时:
Where publish_date >= sysdate -1
或今天任何时候(午夜向前)
or anytime today (midnight forward)
where publish_date >= trunc(sysdate)
如果这是一个大表,我假设您在publish_date上有一个索引.如果您使用trunc(publish_date),它可能无法使用索引(未经测试,但请确保执行一个解释计划).
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).
这篇关于oracle sql date不迟于今天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!