....where
  substr(ac.key_date,1,6)>=to_char(per.start_date,'yyyymm') and 
  substr(ac.key_date,1,6)<=to_char(per.end_date,'yyyymm')

解决方案 »

  1.   

    试试这样:
    select...
    from...
    where
    NVL(SUBSTR(ac.key_date,1,6),'000000')>=to_char(per.start_date,'yyyymm') and 
    NVL(SUBSTR(ac.key_date,1,6),'000000')>=<=to_char(per.end_date,'yyyymm')
      

  2.   

    不知道你key_date的格式是什么
      

  3.   

    是什么格式,如yyyymm还是yyyy-mm
      

  4.   

    yyyymm格式。
    有没有字符串连接的函数,假如我要在某个字段后面加上一个01,怎么做?
      

  5.   

    OKOK,||这个,是这个。靠,我饿了.....
      

  6.   

    我又活着回来了,这几天又让字符串比较给虐了,赛
    我发现几个奇怪的现象,好像大写的字符总是<小写的字符,当然是在个数相等的情况下。
    请问这是怎么回事,从左到右一个一个比较的,直到把where条件中的字符都比较完?
      

  7.   

    SQL> select ascii('A'),ascii('a') from dual;ASCII('A') ASCII('A')
    ---------- ----------
            65         97
      

  8.   

    原来是比较ASCII码阿!!!那是肯定小。