Datatype conversion help - Mailing list pgsql-sql

From Yasir Malik
Subject Datatype conversion help
Date
Msg-id Pine.SGI.4.51.0307081604030.4185018@guinness.cs.stevens-tech.edu
Whole thread Raw
Responses Re: Datatype conversion help  (Michael A Nachbaur <mike@nachbaur.com>)
List pgsql-sql
Suppose I have an integer between 0 and 99 and I want to covert it to
string, and pad leading zeros if neccessary.  For example,
1  => 01
10 => 10

I've tried to_char(in_val, '99'), and that returns a string that is two
charecters, but there isn't a leading zero incase I have the number 2 as
input.  Any ideas?  Thanks.
Yasir


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: Setuid functions
Next
From: Michael A Nachbaur
Date:
Subject: Re: Datatype conversion help