如何在Oracle中获取上个月的数据 [英] How to get last one month data in Oracle

查看:2337
本文介绍了如何在Oracle中获取上个月的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我需要找到今天的最后一个数据.我知道如何获取Sql Server.对于Oracle服务器,我不会有同样的想法.我正在使用Oracle 10g服务器.
该查询应该能够从今天开始提取最近一个月的数据.
在过去的30天中,数据将有效.
我已经尝试过Date_Col> = sysdate-30,但是它不起作用.

Hi..

I need to find the data for the last one from today. I know how to get in Sql Server. I wan''t the same thing for Oracle server. I am using Oracle 10g server.
That query should be able to extract the data for last one month from today.
For the last 30 days data will do..
I have tried Date_Col>=sysdate-30 but it doesn''t work.

推荐答案

阅读以下内容:http://stackoverflow.com/questions/12375888/oracle-date-function-for-the-previous-month [ ^ ]
Read the following: http://stackoverflow.com/questions/12375888/oracle-date-function-for-the-previous-month[^]


我举了一个例子来获取oracle中最近一个月的详细信息....

I have given one example to get last one months detail in oracle....

select * from T_STDN_DETAILS where CREATED_ON>=sysdate-30 and CREATED_ON<=sysdate


这篇关于如何在Oracle中获取上个月的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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