Re: Checking for a number - Mailing list pgsql-general

From Osvaldo Rosario Kussama
Subject Re: Checking for a number
Date
Msg-id 4682D353.3010403@yahoo.com.br
Whole thread Raw
In response to Checking for a number  (Warren <warren@clarksnutrition.com>)
Responses Re: Checking for a number  (Richard Broersma Jr <rabroersma@yahoo.com>)
List 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?
>

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

Osvaldo


pgsql-general by date:

Previous
From: "Danyelle Gragsone"
Date:
Subject: Re: postgres and webmin
Next
From: "Brian J. Erickson"
Date:
Subject: Error Message accessing configuration file