How to set up a specific registration on Database

Posted by ymorenz on Stack Overflow See other posts from Stack Overflow or by ymorenz
Published on 2011-11-28T22:54:59Z Indexed on 2011/11/29 1:50 UTC
Read the original article Hit count: 104

Filed under:
|
|
|

I'm creating a database so I can access names of people from a university. But I would like to create a registration ID for each person like 1012607, of which the first 2 numbers would be the year (11 for 2011) and the third digit would be the semester they registered (1 in the beginning of the year and 2 in the end of the year). The other 4 digits would be incremental. I don't know how to code a prefixed number in MySQL that can change only the last 4 digits and after a year change the first 2 digits every time you have a new registration. Can someone please help me?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql