Created
May 10, 2017 06:25
-
-
Save ibnuh/7ba2c221ca86888280b883e4a693af76 to your computer and use it in GitHub Desktop.
MYSQL: Bikin auto increment with prefix. Ex: GSF00001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT('ABC1',LPAD(id,5,'0')) FROM tablename; | |
http://stackoverflow.com/questions/3245429/autoincrement-of-table-id-using-string-combination-in-database-automatically | |
http://stackoverflow.com/questions/12424153/how-to-use-auto-increment-value-in-mysql-concat-function | |
http://stackoverflow.com/questions/10605383/mysql-creating-a-table-with-auto-increment-and-concatenating-the-values-generat | |
http://stackoverflow.com/questions/17266442/in-mysql-how-can-i-use-the-autoincrement-value-in-another-column-at-the-time-of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment