开发者

Starting the AUTO_INCREMENT with zero

开发者 https://www.devze.com 2023-04-13 04:43 出处:网络
I need some help with MySQL. I have id col开发者_JAVA百科umn on my news table with AUTO_INCREMENT and as usually it assign id=1 for the very first news, id=2 for the second and etc. But I want it to s

I need some help with MySQL. I have id col开发者_JAVA百科umn on my news table with AUTO_INCREMENT and as usually it assign id=1 for the very first news, id=2 for the second and etc. But I want it to start with 001 instead of 1, then 002,003 and so. How can I do that?


Use a numeric field and set the field to ZEROFILL. More on how to use ZEROFILL here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号