mysql 中 实现字段值为BOX001,BOX002.... 每插入一条数据数字部分自增
高洛峰
高洛峰 2017-04-17 16:16:49
0
5
647

mysql 中 实现字段值为BOX001,BOX002.... 每插入一条数据数字部分自增

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
巴扎黑

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.

Ty80

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template