Re: help

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: help
Дата
Msg-id 20030703112252.GB19441@wolff.to
обсуждение исходный текст
Ответ на help  (arun kv <arun@library.iisc.ernet.in>)
Список pgsql-php
On Wed, Jul 02, 2003 at 16:51:11 -0400,
  yanping huang <yanping@altimate.ca> wrote:
> Hi,
> I am learning postgreSQL. Why I can't get a correct result using LPAD?

You are getting a correct result. If you review the documentation on LPAD
you will see that the length is the total length of the resulting string,
not the number of times to repeat the fill string.

>
> select LPAD('Hello',3);   not -> '   Hello'
>  lpad
> ------
>  Hel
>
> select LPAD('ello',3,'H'); not -> 'HHHello'
>  lpad
> ------
>  ell
>
> select LPAD('hen', 1, '^');
>  lpad
> ------
>  h
>
>
> How can I put a '^' befor a variable of VARCHAR type in a function?
>
> Yanping
> --
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org

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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: query, display questions
Следующее
От: "Andrew J. Kopciuch"
Дата:
Сообщение: Re: help