I’ve got an SQLite database that will need to contain products. Those products have a fixed-format composite product number, consisting of category, group and product numbe
I know this is an old question, but the following is simpler:
-- zero-pad to 4 digits: select substr('0000'||3,-4);
substr does not require a length if you’re selecting to the end.
substr