帮我写条sql 表table1中有一个字段reportDate,是Date类型,格式是:2010-9-24 这样的数据,我现在要查询上报日期在2010年9月的数据,应该怎么查,不要用between and 这种方式. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from table1where reportDate=to_date('20100924','yyyymmdd') --你的需求应该是这样的吧select * from table1where to_char(reportDate,'yyyymm')='20100924'; select * from table1where to_char(reportDate,'yyyymm')='201009'; SELECT * FROM To_Char(reportDate,'yyyy-mm')='2010-09' SELECT * FROM TABLE1 WHERE To_Char(reportDate,'yyyy-mm')='2010-09' ; trunc(reportDate,'mm')='2010-09-01' orto_char(reportDate,'yyyy-mm')='2010-09' ORACLE性能调优的视频 求教一个DBlink在存储过程中遇到的问题 请问使用number类型时,指定位宽和不指定是什么区别? oracle 10g 分区功能问题 高分求双机热备解决方法(在线等待、急急急!!!!!) 怎样给存储过程传递数组参数 如何实现数据库的多条件匹配查询? oracle startup启动 __streams_pool_size 问题 SQL执行效率太差,需要优化一下。希望大神指点一下。 oracle dbms_lob.append 遇到奇怪问题 函数 游标
where reportDate=to_date('20100924','yyyymmdd')
select * from table1
where to_char(reportDate,'yyyymm')='20100924';
where to_char(reportDate,'yyyymm')='201009';
SELECT * FROM To_Char(reportDate,'yyyy-mm')='2010-09'
or
to_char(reportDate,'yyyy-mm')='2010-09'