| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера