Re: to_char and '=' weirdness

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: to_char and '=' weirdness
Дата
Msg-id 20020808141154.C14021@zf.jcu.cz
обсуждение исходный текст
Ответ на Re: to_char and '=' weirdness  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Ответы Re: to_char and '=' weirdness  (Frank Joerdens <frank@joerdens.de>)
Список pgsql-sql
On Thu, Aug 08, 2002 at 04:48:24AM -0700, Ludwig Lim wrote:
> 
> > which would appear to indicate that to_char actually
> > yields the string
> > '04109'. Why doesn't the '=' operator work then?
> 
>   I tried running a test sql statement
>  select(length(to_char(99,'00000')))
>  It return six.
> 
>  I think that postgreSQL put a leading blank to
> indicate that it is a positive number (not sure, just
> my opinion)
Right.

>   try using :
>    
>   select to_char(plz,'00000')
>   from andresses 
>   where trim(to_char(plz,'00000'))='04109'
use FM instead trim(): to_char(plz,'FM00000')
...and please, better read  docs :-)
   Karel

-- Karel Zak  <zakkr@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz,
http://mape.jcu.cz


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

Предыдущее
От: Ludwig Lim
Дата:
Сообщение: Re: to_char and '=' weirdness
Следующее
От: Frank Joerdens
Дата:
Сообщение: Re: to_char and '=' weirdness