create table salesman(
salesman_id number(6),
commission(5,2)
);
insert into salesman(salesman_id,
commission)
values (0001, 0.15);
select * from salesman => commission shows as .15
How can I create table where commission would show as 0.15?
create table salesman(
salesman_id number(6),
commission(5,2)
);
insert into salesman(salesman_id,
commission)
values (0001, 0.15);
select * from salesman => commission shows as .15
How can I create table where commission would show as 0.15?
You have three choices. Either select the column as a string and do the conversion:
select to_char(commission, '0.00')
Or store the value as a string. Leading zeros do not affect the "number". If you care about them, you need to store them explicitly (i.e. as a string) or generate the value as a string in the format you want.
The third option is to reformat at the application level.