If you do not consider number jumps, the simplest way is to create two fields, one field to save the BOX, one field to be the auto-increment, and two fields to be used as Usually this encoding is to be displayed, so When writing a program, you only need simple splicing and formatting. If there are complex logic checksums and higher requirements, it is recommended to write them in the business logic layer.
In mysql, provide an idea. You can split this and store it in two fields. The prefix BOX is a field, and the following number is a field (num) 001. Then every time you insert data, it is fetched from this table. The table header (BOX) is concatenated with the following number (num) column. After inserting the data, remember to change the num column + 1 according to the prefix. It's a bit like the order number generation rules we did before.
If you want to try sequence, you can check out the link description of this article
This kind of logic is better handled by a program (php or py)
It is recommended to handle it in the business logic layer of the development language
If you do not consider number jumps, the simplest way is to create two fields, one field to save the BOX, one field to be the auto-increment, and two fields to be used as
Usually this encoding is to be displayed, so When writing a program, you only need simple splicing and formatting.
If there are complex logic checksums and higher requirements, it is recommended to write them in the business logic layer.
In mysql, provide an idea. You can split this and store it in two fields. The prefix BOX is a field, and the following number is a field (num) 001. Then every time you insert data, it is fetched from this table. The table header (BOX) is concatenated with the following number (num) column. After inserting the data, remember to change the num column + 1 according to the prefix. It's a bit like the order number generation rules we did before.