使用 Oracle SQL 的日期增量
我们每天晚上使用 SQL 发送邮件。为此,我们特别希望每 3 天发送一次提醒,但我完全不知道该怎么做,或者是否可能?
这是我的代码:
SELECT *
FROM table
WHERE status = 'pending'
AND ( date_created = sysdate - 3
OR date_created = sysdate - 6
OR date_created = sysdate - 9 )
达到这种效果的东西,但是一种更好的编码方式,也是一种更有效的方式,不需要我一路进入数百个! ^_^
谢谢
We send mailouts every evening using SQL. For this in particular we'd like to send a reminder every 3 days, but I have absolutely no idea how to do this, or if it's even possible?
Here's my code:
SELECT *
FROM table
WHERE status = 'pending'
AND ( date_created = sysdate - 3
OR date_created = sysdate - 6
OR date_created = sysdate - 9 )
Something to that effect, but a nicer way of coding it and also a more effective one that won't require me to go all the way into the hundreds! ^_^
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
有关 Oracle MOD 的信息:http://download.oracle .com/docs/cd/B19306_01/server.102/b14200/functions088.htm
Try
Information on Oracle MOD: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions088.htm