I have a column STAT in table INFO which is currently of integer data type. But while displaying I want to display it as Char(4).In most of the records the field is of 4 digits but in some records it is of 3 digits where I need to display it as '0***' (Left padded by zeroes).
How can I do it???
I tried CAST function as:
SELECT CAST (STAT AS CHAR(4)) FROM INFO;
But for 3 digit value it is displaying it as 3 digit only inspite of using char(4) in the cast statement. I want to display it as char(4).
How can I do it??
I tried coalesce also....But