SyntaxFix
Write A Post
Hire A Developer
Questions
As easy as
SELECT lpad(42::text, 4, '0')
References:
sqlfiddle: http://sqlfiddle.com/#!15/d41d8/3665