Re: type-casting and LIKE queries

Поиск
Список
Период
Сортировка
От James Gregory
Тема Re: type-casting and LIKE queries
Дата
Msg-id 1047666344.4241.1.camel@pirate.bridge.anchor.net.au
обсуждение исходный текст
Ответ на type-casting and LIKE queries  (valerian <valerian2@hotpop.com>)
Ответы Re: type-casting and LIKE queries  (valerian <valerian2@hotpop.com>)
Список pgsql-general
On Fri, 2003-03-14 at 06:26, valerian wrote:
> I have an indexed column called home_phone, which is of type bigint.
> How can I search this column efficiently, using LIKE queries?  For
> example:
>
>    test=> SELECT id FROM user WHERE home_phone LIKE '407%'::bigint;
>    ERROR:  Bad int8 external representation "407%"

try something like

where home_phone::text like '407%'

or alternatively harness the immense power of algebra to achieve your
devious ends :)

HTH,

James.



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: type-casting and LIKE queries
Следующее
От: merlyn@stonehenge.com (Randal L. Schwartz)
Дата:
Сообщение: constant scalar subselect no longer equivalent to constant?