Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting auto increment

Status
Not open for further replies.

jimmorton

Programmer
May 14, 2002
2
GB
I would like to create a unique key with the format t0000 (letter followed by four digits) to be incremented automatically (t0001, t0002, etc) when a new record is created. Can auto increments be formatted to achieve this or do I need to use seperate fields.

Thanks, Jim
 
Integers can not have a leding to or leading 0. You can fix it in your presentation.

select concat('t',right(concat('000' ,id),4)) from t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top