|
How to generate alphanumeric auto increment id in mysql
|
|
|
|
|
Hi,
We have a forum for MySql Problems, I suggest you move your post here[^]
Regards,
Keith
|
|
|
|
|
|
You have to store the key as two columns. A char prefix and an auto-incrementing int, both of which are grouped for the primary key.
CREATE TABLE my_table(
id INT NOT NULL AUTO_INCREMENT,
prefix CHAR(30) NOT NULL,
PRIMARY KEY (id, prefix),
...
Say, prefix is here 'PRF', then you get PRF1, PRF2, PRF3, ..........
|
|
|
|
|
this didnt work only created a collum for prefix
|
|
|
|