type-casting and LIKE queries

Поиск
Список
Период
Сортировка
От valerian
Тема type-casting and LIKE queries
Дата
Msg-id 20030314062602.GA32380@hotpop.com
обсуждение исходный текст
Ответы Re: type-casting and LIKE queries  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: type-casting and LIKE queries  (James Gregory <james@anchor.net.au>)
Список pgsql-general
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%"

Obviously, that's not correct, but I'm confused as to how the % and ?
characters can be used along with type-casting.  Or can they?



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

Предыдущее
От: "shreedhar"
Дата:
Сообщение: Is there any tool to set up database automatically
Следующее
От: John Smith
Дата:
Сообщение: Re: data mining and warehousing