composite (alphanumeric) primary key and auto increment
Is it possible to make an auto-increment function in MySQL that combines alpha elements and numeric? I have an existing system with keys like QAb99, QAb101, QAd9003, etc. The max numeric portion ranges from 1 to 9999, while the letters begin with QA and range from QAa to QAd, etc. and will eventually pass QAd9999 to QAe1, etc. Is it better to manage generating new keys in SQL or outside of SQL (i.e. php script)? thanks. I asked this a while ago. Mysql doesn't do this unfortunately. I'd love it to, but it just doesn't. In php you could do it. Example: public function random_id_gen($length) { /