Im having an issue attempting to increment unique ids for a table in MySQL. I have values I would like to keep as RX##### which I have labeled as a Primary key (prescriptionid).
Is there a way to increment the unique id when a new row is inserted?
prescriptionid
RX00001
RX00002
RX00003
CREATE TABLE prescription
( ID INT AUTO_INCREMENT,
prescriptionid AS 'RX' + RIGHT('00000' + CAST(ID AS CHAR(5)), 5) PERSISTED,
.
.
PRIMARY KEY (prescriptionid),
.
.
...);