Search Postgresql Archives

Re: Checking for a number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Warren escreveu:
I need to check if the last two characters of a field are a number. I am trying something like this but it does not want to work.

substring(TRIM(field8) from '..$') SIMILAR TO '\d\d'

How should I do this?


Try:
SELECT your_field ~ '.*[[:digit:]]{2}$';

Osvaldo



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux