在MS SQL 中,select code from table  where code like 'A[0-9]%' 查询出 CODE 以A0,A1,A2,A3,A4,..A9开的资料请问postgresql,或mysql有没有此项语法,有又是如何写的?

解决方案 »

  1.   

    mySQL中可以用regexp通过正则式来实现
      

  2.   

    select code from table  where code REGEXP binary '^A[0-9]' 
      

  3.   

    where code like 'A%' and instr('0123456789',SUBSTRING(code,2,1))>0
      

  4.   

    可以 用REGEXP
    select * from jzg1 where bh REGEXP '^1[0-9]'
      

  5.   

    where code REGEXP '^A\d.*'
      

  6.   

    select * from jzg1 where bh REGEXP '^A[0-9]'
      

  7.   

    多谢大家我也知道postgresql 的写法select code from table  where code ~ '^A[0-9]'