select substr(产品编号,15,4) from 表
where substr(产品编号,7,8) between '20020801' and '20020831';

解决方案 »

  1.   

    select substr(code, 15) from table where to_date(substr(code, 7, 8), 'yyyymmdd') > 2002年8月1日 and to_date(substr(code, 7, 8), 'yyyymmdd') < 2002年8月31日
    大概是这个意思,语法你自己调整一下.
      

  2.   

    select substr(产品代码,15,4) from yourtable
    where substr(产品代码,11,2)='08'
    and count(distinct(substr(产品代码,13,2)))=31
      

  3.   

    select 流水线编号 from tablename where to_number(substr(产品编号,13,2)) between 1 and 31;不知是不是这个意思
      

  4.   

    select substr(产品代码,15,4),count(distinct(substr(产品代码,13,2))) from yourtable
    where substr(产品代码,11,2)='08'
    group by substr(产品代码,15,4)
    得出的结果为31的即为你要的流水线编号
      

  5.   

    或者是
    select substr(产品代码,15,4) from yourtable
    where substr(产品代码,11,2)='08'
    group by substr(产品代码,15,4)
    having count(distinct(substr(产品代码,13,2)))=31 
    这样列出的就是结果了
      

  6.   

    你再把条件里加上2002年不就行了,
    select substr(产品代码,15,4) from yourtable
    where substr(产品代码,7,6)='200208'
    group by substr(产品代码,15,4)
    having count(distinct(substr(产品代码,13,2)))=31