Link to home
Start Free TrialLog in
Avatar of comtekso
comtekso

asked on

Prepend and Auto Increment Primary key?

How do you prepend and auto increment primary key? I would like to prepend it with a letter. What would I change the data type to?
Avatar of ellandrd
ellandrd
Flag of Ireland image

>>What would I change the data type to?

CREATE TABLE tblInfo (
      ID INT NOT NULL AUTO_INCREMENT,
      title VARCHAR(150),
      category VARCHAR(150),
      PRIMARY KEY(ID)
)
you would then attach the value to your letter header or title
Avatar of comtekso
comtekso

ASKER

I'm not sure I understand. Would that allow me to have the ID be something like a1, a2, a3 etc...?
ASKER CERTIFIED SOLUTION
Avatar of ellandrd
ellandrd
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK thanks.
did you find your answer?
thank you for grade!!!

;-)