Re: Pattern Matching - Range of Letters - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Pattern Matching - Range of Letters
Date
Msg-id 538480.67730.qm@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Pattern Matching - Range of Letters  (Ron St-Pierre <ron.pgsql@shaw.ca>)
Responses Re: Pattern Matching - Range of Letters
Re: Pattern Matching - Range of Letters
List pgsql-general
--- Ron St-Pierre <ron.pgsql@shaw.ca> wrote:

> I'm sure that others have solved this but I can't find anything with my
> (google and archive) searches. I need to retrieve data where the text
> field is within a certain range e.g.
> A-An
> Am-Bc
> Bc-Eg
> ....
> Yi-Zz
>
> Does anyone know of a good approach to achieve this? Should I be looking
> into regular expressions, or maybe converting them to their ascii value
> first?

Regular expressions would work, but a between statement should work also.

SELECT *
  FROM Your_table AS YT
 WHERE YT.text_field BETWEEN 'Aa' AND 'An';


pgsql-general by date:

Previous
From: Ron St-Pierre
Date:
Subject: Pattern Matching - Range of Letters
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Pattern Matching - Range of Letters