How to format a leading zero

When the output type is numeric, Vertica does not print a leading 0. like vsql=> select 0.123 ; ?column? ---------- .123


  • o print a leading zero use a template as shown below. vsql=> select to_char(0.123,'0.000'); to_char --------- 0.123 (1 row) vsql=> select to_char(.123,'0.000'), to_number('.123','0.999'); to_char | to_number ---------+----------- 0.123 | 0.123 Note: Please see Template Patterns for Numeric Formatting in the SQL Reference Manual

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file