user260192
user260192

Reputation:

build a formatted string in oracle

I need to build a string from some columns into another column, the trailing zeros must be removed from month and day :

YEAR=2008;MONTH=1;DAY=1;ID=1021; ... etc

For the day piece I've used the TO_CHAR(D_RIC,'D') function to remove leading zeros. Is there a format option for months to remove starting zeros too ?

Upvotes: 1

Views: 435

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132570

"Fill Mode" (FM):

select to_char (datecol, 'FMMM') from mytable;

Upvotes: 2

Related Questions