Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread Ron St-Pierre
William Garrison wrote: That won't work if you have a value "Anz" in there. It would be in the gap between An and Am. Yes, I realized that too. My solution to it is a bit of a hack, but it's easy and it works for me in this case. I translate everything to uppercase and simply append 'ZZ' t

Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread William Garrison
That won't work if you have a value "Anz" in there. It would be in the gap between An and Am. create table test (test text); insert into test values ('A'); insert into test values ('b'); insert into test values ('c'); insert into test values ('d'); insert into test values ('e'); insert into tes

Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread Ron St-Pierre
Thanks Richard and Joshua, I had no idea that BETWEEN worked for text. SELECT * FROM Your_table AS YT WHERE YT.text_field BETWEEN 'Aa' AND 'An'; postgres=# select * from test where test between 'A' and 'An'; test -- A Ab Ac (3 rows) Ron Ron St-Pierre wrote: I'm sure that others have s

Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread John D. Burger
Richard Broersma Jr wrote: --- Ron St-Pierre <[EMAIL PROTECTED]> 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 Regular expression

Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread Joshua D. Drake
Ron St-Pierre 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 l

Re: [GENERAL] Pattern Matching - Range of Letters

2007-05-10 Thread Richard Broersma Jr
--- Ron St-Pierre <[EMAIL PROTECTED]> 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