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!

Syntax problem create table

Status
Not open for further replies.

bossyman

Programmer
Jun 20, 2005
1
BE
Hello all,

I have to create a table. One of the columns (primary key) has to start with ex. "2006B" and after that there has to be an autoincrement.
Can anyone help me with the syntax if it is possible to have such a syntax ?
 
use an ordinary auto_increment as the real primary key, and "assemble" your key value for every query like this --

select concat('2006B',lpad(id,8)) as concatkey
from yourtable

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top