Colt Brunton wrote:

Hi folks
I need a MySQL statement that will calculate a new unique identifier for
each record in a table.
The identifier format is "AAAA-888" where the letters are the first four
letters of the company's name and the 3 digit number is accounts for
each occurrence of the letters.
E.G. MadMax Ltd should produce the key, "MADM001".
Any ideas?

use an PRIMARY KEY over two fields


field1 is your Company's Name
and Field2 is an integer autoincrement-field

this is explained here:
http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html



--
Sebastian Mendel

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com


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



Reply via email to