How to Auto Increment ID Numbers with Letters and Numbers

后端 未结 5 1455
眼角桃花
眼角桃花 2021-01-03 13:54

How to Auto Increment ID Numbers with Letters and Numbers, example \"KP-0001\" it will increment to \"KP-0002\"

Thank you!

5条回答
  •  旧时难觅i
    2021-01-03 14:04

    You can't auto increment varchar data type. Other way of doing this is to bifurcate varchar column into two different columns one will have integer part and other will have alphabet like in your case KP- once you auto increment all integer rows just concatenate these two columns

提交回复
热议问题