Is there a way to insert an auto-incremental primary id with a prefix in mysql database?

前端 未结 2 1149
一生所求
一生所求 2020-12-18 09:24

I\'m trying to insert a data as a primary ID that has one alphanumerical value and two numerical value in MySQL database. This data will auto incrementally generate number,

2条回答
  •  一个人的身影
    2020-12-18 09:43

    We can't set auto-increment for alphanumeric. In your case if D is always same then no need to add it to your pk field. Keep your constant in a separate field and add it when you select.

提交回复
热议问题