At 04:00 PM 27-04-2001 -0500, will trillich wrote:
>On Fri, Apr 27, 2001 at 09:52:26AM -0500, Len Morgan wrote:
>>
>> SELECT * FROM table WHERE last_name BETWEEN 'A' AND 'Fzzzzzzzzzzzzz' ;
>> worked for me.
>>
>> You could also use BETWEEN 'A' AND 'G' to avoid all of the zzzzzzzzs at the
>> end. Crude but effective.
>
>how about regex?
>
> select * from tbl where fld ~ '^[A-F]';
Would the regex query still use a basic text index?
If you're using US-ASCII encoding you could avoid the zzzzs by using a '~'
e.g.
SELECT * FROM table where last_name >='A' and last_name <='F~';
If not use a < 'G' instead of a <=.
Cheerio,
Link.