select max(floor(substring(fname,3))) from $dt你不会是没分了吧!

解决方案 »

  1.   

    上面的语句是从该列所有元素中判断,如果要过滤掉f_xx.rec和f_xx.u这些元素select max(floor(substring(fname,3))) from $dt where str not like '%.%'select max(floor(substring(fname,3))) from $dt where instr(str,".")=0
      

  2.   

    为什么要加上floor函数?
    select max(floor(substring(fname,3))) from $dt where str not like '%.%'
    这句。
      

  3.   

    不加上floor没法比较大小,因为还是字符串
      

  4.   

    不是吧?substring以后成了数字了已经。
    而且如果是字符串的话f_99和f_110哪个大?另外,where str not like '%.%'里面的str是什么?
      

  5.   

    哦哪个str是我做测试没有改成你的fname
      

  6.   

    select max(floor(substring(fname,3))) from $dt where fname not like '%.%'orselect max(floor(substring(fname,3))) from $dt where instr(fname,".")=0
      

  7.   

    substring(fname,3)出来以后是完整的数字吧?即1、2、……xxx。
    这样还要floor?