id     name
1      test 
2      测试
3      test1
4      test2
5      tt3
6      测试1怎样找出以数字结束的这些记录?

解决方案 »

  1.   

    select * from tablename
    where substr(name,-1) in ('0'..'9')
      

  2.   

    select *
    from t
    where regexp_like(name,'[0-9]$');
      

  3.   

    如果是10g,可以考虑用REGEXP_LIKE
      

  4.   

    9i就用1楼的方法。
    select * from tablename
    where substr(name,-1) in ('0','1','2','3','4','5','6','7','8','9');
      

  5.   

    select * from tablename
    where substr(name,-1) in ('0','1','2','3','4','5','6','7','8','9');
    这个方法是正解。
    substr(name,-1)这个是取最后一位,我刚在PL/SQL试了试,能用,受教了
      

  6.   

    本QQ群新建
      希望能和大家一起探讨oracle各方面的问提
        QQ群号:54775466
        QQ群号:54775466
       期待你的加人
                积极讨论者 爱好者进
                          本群欢迎您的到来。
      

  7.   


      select * from tablename where ascii(substr(name,-1)) between 48 and 57;