Re: to_char adds leading space, intended?

From: rolf(dot)ostvik(at)axxessit(dot)no
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: to_char adds leading space, intended?
Date: 2002-01-03 07:39:40
Message-ID: OF36E25CE3.8C3DF18B-ONC1256B36.00291D75@axxessit.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On 2002-01-03 "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com> wrote:
>envisity=# SELECT '''' || to_char(1234, '099999') || '''';

> ?column?
>-----------
> ' 001234'
>(1 row)

Modifier "FM" in the format string is your friend
SELECT '''' || to_char(1234, 'FM099999') || '''';
^^

Table 4.11 on
http://www.postgresql.org/idocs/index.php?functions-formatting.html
--
AXXESSIT ASA http://www.axxessit.no
Rolf Østvik / Test technician
Phone : (+47) 69 17 38 19 Fax: (+47) 69 17 39 00
P.O. Box 1053, Isebakkevn. 25, N-1787 Berg i Østfold

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Bertheau 2002-01-03 14:59:08 Re: change null to 0 in SQL script
Previous Message Karl Raven 2002-01-03 05:00:44 change null to 0 in SQL script