Skip site navigation (1) Skip section navigation (2)

Re: Checking for a number

From: Osvaldo Rosario Kussama <osvaldo_kussama(at)yahoo(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Checking for a number
Date: 2007-06-27 21:14:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
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?

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


In response to


pgsql-general by date

Next:From: Richard Broersma JrDate: 2007-06-27 21:17:48
Subject: Re: Checking for a number
Previous:From: Andrej Ricnik-BayDate: 2007-06-27 21:11:11
Subject: Re: postgres and webmin

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group