Reputation: 1112
I want to get auto increment default sequence as CURRENT_TIMESTAMP (with 2 digits 'year' format) + ID (5 digits)...
Like this:
If current year is 2020,
2010001, 2010002, 2010003, ...
If current year is 2021,
2110001, 2110002, 2110003, ...
Please, help me out, and give me any idea.
Upvotes: 0
Views: 288
Reputation: 246918
Use a normal sequence, set its value to 2010000, and at the beginning of 2021 set it to 2110000.
Upvotes: 1