oracle sql date不迟于今天 [英] oracle sql date not later than today

查看:86
本文介绍了oracle sql date不迟于今天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果是 - 新数据 -更新数据 假设,我将基于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆