pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Alessandro Rossi <alex@sunrise.radiostudiodelta.it>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] RETURN VALUES ON INTEGERS
Date: Wed, 7 Jul 1999 15:52:51 +0300
Message-ID: <l03130303b3a8fdf5f0d5@[147.233.159.109]> (raw)
In-Reply-To: <Pine.LNX.4.05.9907071423230.12067-100000@sunrise.radiostudiodelta.it>

At 15:24 +0300 on 07/07/1999, Alessandro Rossi wrote:


> I GET:
>
> id|code|status
> --+------+------
>  1| 44111|N
>  2|   123|S
>
> BUT I WOULD LIKE TO GET
>
> id|code|status
> --+------+------
>  1|044111|N
>  2|000123|S
>
> How could I fix the prbolem and get the values as I ned them out of the
> select ?

Try lpad. For example:

testing=> select num, lpad( num, 6, '0' ) from test1;
   num|  lpad
------+------
     2|000002
     4|000004
    38|000038
   199|000199
100399|100399
(5 rows)

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (4+ messages)  latest in thread

Message-ID: <l03130303b3a8fdf5f0d5@[147.233.159.109]>
Permalink:  ../l03130303b3a8fdf5f0d5@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03130303b3a8fdf5f0d5@[147.233.159.109]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: herouth@oumail.openu.ac.il, alex@sunrise.radiostudiodelta.it
  Subject: Re: [SQL] RETURN VALUES ON INTEGERS
  In-Reply-To: <l03130303b3a8fdf5f0d5@[147.233.159.109]>
  References: <Pine.LNX.4.05.9907071423230.12067-100000@sunrise.radiostudiodelta.it> <l03130303b3a8fdf5f0d5@[147.233.159.109]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox