Re: LIKE with no wildcards problem

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: LIKE with no wildcards problem
Дата
Msg-id web-813010@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на LIKE with no wildcards problem  ("John J. Allison" <john@joss.ucar.edu>)
Список pgsql-sql
John,

> When doing a select with a LIKE in the where clause,
> I always get 0 rows if I do not use a wildcard [_%].
> LIKE should act like = in this case (and the docs say so).
> A select without a from correctly returns 't'.
> I am using PostgreSQL 7.1.3 on Solaris.
> What am I missing?

> catalog^> create table foo ( bar char(8) )
> CREATE
>

You created the column bar as CHAR(8), which means what's actuallybeing stored is "abc     " not "abc".  I think you
wantto use VARCHARinstead.
 

-Josh


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

Предыдущее
От: "John J. Allison"
Дата:
Сообщение: LIKE with no wildcards problem
Следующее
От: Ian Barwick
Дата:
Сообщение: Re: LIKE with no wildcards problem