0

I have a database table for track some kind of data, you can check my table code below.

CREATE TABLE CaseTracker(
    CTID CHAR(15) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    Status CHAR(10) NOT NULL,
    CreatedBy CHAR(15) NOT NULL,
    CreatedOn CHAR(15) NOT NULL,
    UpdatedBy CHAR(15),
    UpdatedOn CHAR(15),
    IPAddress CHAR(20) NOT NULL,
)

And In This Website when i insert any data its done successfully, but right now my PRIMARY KEY default value is like (1, 2, 3, 4...), it's Set to AUTO_INCREMENT but i want to change my primary key value with trackcode/moth-date/AUTO_INCREMENT value Like kcs/nov-12/001 in next moth its change with kcs/dec-01/090

is there any idea or help for me ?

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
  • Possible duplicate of [creating primary key based on date](https://stackoverflow.com/questions/5455436/creating-primary-key-based-on-date) – Yaroslaw Nov 12 '18 at 11:47
  • Possible duplicate of [How to put text in front of auto increment field in mysql (like : TTT00001)?](https://stackoverflow.com/questions/43553282/how-to-put-text-in-front-of-auto-increment-field-in-mysql-like-ttt00001) – Mohammad Nov 12 '18 at 11:48

0 Answers0