Datatype conversion help

Поиск
Список
Период
Сортировка
От Yasir Malik
Тема Datatype conversion help
Дата
Msg-id Pine.SGI.4.51.0307081604030.4185018@guinness.cs.stevens-tech.edu
обсуждение исходный текст
Ответы Re: Datatype conversion help
Список 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 по дате отправления: