Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- auto incerment string with number
November 8, 2011, 9:05 pm
rate this thread
that table is fine. But my problem is that i want to increment a
combination of string and integer. For example String : ABC is the
starting code for the unique id.
First Id of my table should be primary key and
ie ABC10001, ABC10002,..... and so on.
Without using another key as auto-increment. Please do not use two
type of unique key.
Re: auto incerment string with number
If you are not planning on incrementing the string part
then you can use CONCAT with your SELECT statements like:
SELECT CONCAT('ABC',`id`) FROM `my_table`;
which will produce something like
- » /usr/bin/ld: cannot find -lmysqlclient_r installing ruby gem mysql2.... in Fedora Linux + ...
- — Next thread in » MySQL Database Forum
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum