Re: [SQL] Finding strings inside a field...

Поиск
Список
Период
Сортировка
От Tim J Trowbridge
Тема Re: [SQL] Finding strings inside a field...
Дата
Msg-id 199806292139.QAA20652@earth.execpc.com
обсуждение исходный текст
Ответ на Finding strings inside a field...  (Dan Delaney <dionysos@dionysia.org>)
Список pgsql-sql
Dan Delaney wrote:
>
> Hello all.
>    Could any one tell me if the following is possible using
> PostgreSQL?
>
> I want to be able do a SELECT and search for a string INSIDE OF a
> field. So, say I want to get all record in testtable which contain
> the word "foobar" inside the "description" attribute. The following
> will only get those records in which the "description" attribute
> contains ONLY the word "foobar":
>
> SELECT FROM testtable WHERE description='foobar';

Try this:

SELECT FROM testtable WHERE description like '%foobar%';

Note that this isn't case insensitive.



--
Tim J Trowbridge                         trowbrid@writeme.com
Interested in my genealogy?          http://www.execpc.com/~trowbrid

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

Предыдущее
От: Dan Delaney
Дата:
Сообщение: Finding strings inside a field...
Следующее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: [SQL] Finding strings inside a field...