Re: Syntax for wildcard selection

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Syntax for wildcard selection
Дата
Msg-id 20010816094531.A16062@svana.org
обсуждение исходный текст
Ответ на Syntax for wildcard selection  (Scott Holmes <sholmes@pacificnet.net>)
Ответы Re: Syntax for wildcard selection  (Scott Holmes <scott@pacificnet.net>)
Список pgsql-general
On Wed, Aug 15, 2001 at 04:06:16PM -0700, Scott Holmes wrote:
> This question just came up from a user use to our Informix application.  They
> tried to do a wildcard search, thus "where field_name LIKE 'AB%VN'".  The
> trailing values (after the %) are not recognized correctly.  With Informix
> 4GL, we wrote "where field_name MATCHES 'AB*VN'".  This finds any combination
> of values with 'AB' as the first two characters, and 'VN' as the last two,
> with any number of characters in between - including blanks.  How is this
> accomplished with PostgreSQL?  Are we limited to wildcard searches as "where
> field_name LIKE 'AB%'"?

The only thing I can think of is that you are using char() fields and the
like is getting confused by the trailing spaces. Certainly putting wildcards
anywhere in the string works fine.

What is the data type of your column? text and varchar() wouldn't suffer
from the above problem.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

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

Предыдущее
От: Jason Turner
Дата:
Сообщение: Re: Syntax for wildcard selection
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Syntax for wildcard selection