select * from  t_comm_businessmonth
where businessmonth = 
to_date('2005-08-01', 'yyyy-mm-dd')是不是等同于SQL server 里的select * from t_comm_businessmonth 
where Month(businessmonth) = 8

解决方案 »

  1.   

    当然不一样了,一个是'2005-08-01',一个是'XXXX-08-XX'
      

  2.   

    当然不等同了
    select * from  t_comm_businessmonth
    where businessmonth = 
    to_date('2005-08-01', 'yyyy-mm-dd')
    是取businessmonth 为2005年8月1日 零时零分零秒的数据
    select * from t_comm_businessmonth 
    where Month(businessmonth) = 8
    是到businessmonth 为8月的数据,不管是哪一年的
      

  3.   

    哦!我打错!呵呵
    SQL Server
    select * from t_comm_businessmonth 
    where Month(businessmonth) = 8 and Year(businessmonth) = 2005Oracle 怎么写?
      

  4.   

    select * from  t_comm_businessmonth
    where to_char(businessmonth,'yyyymm' ='200508'
      

  5.   


    select * from  t_comm_businessmonth
    where to_char(businessmonth,'yyyy-mm') ='2005-08';