Try this:
concat('UP', lpad(category_id, 6, '0'));

Scott Purcell wrote:

Hello,

I have the following dilemma, that I do not know how to handle.

I have the need for a table where I create a identifier. The identifier consists of a two character string, eg: "UP" + the next "AUTO_INCREMENT" Here is what I have.

      category_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

Table should look like this:
UP000001
UP000002
UP000003

So the problem is, how can I grab the auto_increment number, then append the 
prefix while doing an insert?

Can anyone give me some advice on this problem?

Thanks,
Scott



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to