Re: select a range of data

Поиск
Список
Период
Сортировка
От Jon Sime
Тема Re: select a range of data
Дата
Msg-id 46A10AB1.8040103@mediamatters.org
обсуждение исходный текст
Ответ на select a range of data  (Jessica Richard <rjessil@yahoo.com>)
Список pgsql-admin
Jessica Richard wrote:
> If I have a column with a value like "abc2457", "efg1234",
>
> how do I select col from table where col like 'a[a-z]c24[0-9]7"?
>
> How do I handle the range bracket in the query?

You can use the regular expression operator(s), like so:

     select *
     from table
     where column ~ 'a[a-z]c24[0-9]7';

For the full details:
http://www.postgresql.org/docs/8.2/interactive/functions-matching.html#AEN9312

-Jon

--
Senior Systems Developer
Media Matters for America
http://mediamatters.org/

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: select a range of data
Следующее
От: Michael Monnerie
Дата:
Сообщение: Re: syslog: log line length?