Re: using CAST and LIKE

Поиск
Список
Период
Сортировка
От Timothy Wood
Тема Re: using CAST and LIKE
Дата
Msg-id 1018906488.29837.31.camel@phobos
обсуждение исходный текст
Ответ на Re: using CAST and LIKE  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: using CAST and LIKE  (Alvaro Herrera <alvherre@atentus.com>)
Список pgsql-general
On Mon, 2002-04-15 at 15:46, Tom Lane wrote:
> Timothy Wood <timothy@hallcomp.com> writes:
> > SELECT * FROM table WHERE CAST('field' AS TEXT) LIKE '%value%';
>
> I think you meant
>
> SELECT * FROM table WHERE CAST(field AS TEXT) LIKE '%value%';
>
>             regards, tom lane
>

Ahh, that does seem to work.  Big difference without the single quotes.
What exactly is the big difference there or what do the single quotes do
that I was not aware of when I used them?

The regular expressions do seem like a better idea, but is there any
benefit over one or the other aside from the flexibility of the regexps?

Thanks again

Timothy,


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

Предыдущее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: How do I list all users and all databases.
Следующее
От: elein
Дата:
Сообщение: Re: DataBlades