Re: How to search ignoring spaces and minus signs

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah
Тема Re: How to search ignoring spaces and minus signs
Дата
Msg-id AANLkTimAz=4wX+X_1HtVYQFu6+H800YE-m1TsJEEQzGo@mail.gmail.com
обсуждение исходный текст
Ответ на How to search ignoring spaces and minus signs  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
Dear Andrus,

Quick & Dirty Soln:

SELECT * from  table where regexp_replace( col   , '[-\\s+]' , '' ,
'g')  ilike '%search_term%'  ;

note above sql will not use any index if you have to search 10000s of
rows use alternate
approaches.

regds
Rajesh Kumar Mallah.



2010/10/13 Andrus <kobruleht2@hot.ee>:
> CHAR(20) columns in 8.4 database may contains spaces and - signs like
>
> 13-333-333
> 12 3-44
> 33 33 333
> 12345
>
> User enters code to search without spaces and - signs, like 12344
> How to search for product code ignoring spaces and - signs?
>
> For example searching for code 12344 should return
> 12 3-44  as matching item.
>
> Andrus.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Adding a New Column Specifically In a Table
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Adding a New Column Specifically In a Table