oracle怎么查询某一个月的数据

2025年03月01日 11:33
有3个网友回答
网友(1):

你好:这个查询方式有很多;

select * from tableName where DATEPART(mm, theDate)
=DATEPART(mm, GETDATE()) and DATEPART(yy, theDate) 
= DATEPART(yy, GETDATE());
-----------可以用以下方法查找
select * from tableName  t where t.dateTime =to_DATE('yyyy-mm','2014-12')

网友(2):

select * from 表名 where 时间列 in (select (to_date('20171007','yyyymmdd')-rownum+1) from dual connect by rownum<=30);

网友(3):

select * from 表名
where 日期(日期那列的名字)>= '2017.10.01'
and 日期<= '2017.10.05'