| От | Timothy Wood |
|---|---|
| Тема | using CAST and LIKE |
| Дата | |
| Msg-id | 1018897728.29837.21.camel@phobos обсуждение исходный текст |
| Ответы |
Re: using CAST and LIKE
|
| Список | pgsql-general |
Hi all,
Sorry if this has already been posted but the archives, as you probably
already know, aren't searchable right now and I did not see anything
relevant when I sifted through them. Anywho, I'm trying to use a type
cast in a where ... like select statement and I've done it like so:
SELECT * FROM table WHERE CAST('field' AS TEXT) LIKE '%value%';
now the field I'm casting, be it already of type text or not, never
returns any rows. However if I use a field that is already of text type
and do not cast it then I get resluts. So my question is is there any
way to use CAST and LIKE together in the same select or am I
missing/doing something wrong? Thanks.
Timothy,
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера