By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| SUBSTR(TOTAL_APPLES,1,4)||'-'||SUBSTR(TOTAL_APPLES,5) |
|---|
| 1234-56 |
| REGEXP_REPLACE(TOTAL_COUNT_PRODS('APPLE'),'(\D{2})$','-\1') |
|---|
| 1234-56 |
| TO_CHAR(TOTAL_COUNT_PRODS('APPLE')/100,'FM9999D99','NLS_NUMERIC_CHARACTERS=-,') |
|---|
| 1234-56 |