0

I've created a database in MySQL which has a user_id that is primary key and auto incremented. Now my question is can I insert a static data in a column that is auto incremented? For example I want to insert a data "U-01" instead of just 1 only.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • 1
    um, you can just concatenate it with the string of your liking you know – Kevin Jun 27 '19 at 04:32
  • 2
    If you want insert "U-01" then the column be can't be integer, AUTO_INCREMENT can only be used on column types of integer! Perhaps it gives a little workaround which is described here: https://stackoverflow.com/questions/14038586/auto-increment-varchar-in-mysql – CodyKL Jun 27 '19 at 04:41

1 Answers1

0

The column must be unauto increment, then you can insert this data!

swoft
  • 20
  • 2