Re: SQL Where Like - Range it?!

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Re: SQL Where Like - Range it?!
Дата
Msg-id 3.0.5.32.20010428105308.00f8a700@192.228.128.13
обсуждение исходный текст
Ответ на Re: SQL Where Like - Range it?!  (will trillich <will@serensoft.com>)
Ответы Re: Re: SQL Where Like - Range it?!  (will trillich <will@serensoft.com>)
Список pgsql-general
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.



В списке pgsql-general по дате отправления:

Предыдущее
От: webb sprague
Дата:
Сообщение: Diagnostic
Следующее
От: will trillich
Дата:
Сообщение: Re: Re: SQL Where Like - Range it?!