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.
Asked
Active
Viewed 63 times
0
-
1um, you can just concatenate it with the string of your liking you know – Kevin Jun 27 '19 at 04:32
-
2If 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