MySQLã§ãªã¼ãã¤ã³ã¯ãªã¡ã³ãã®å¤ããªã»ããããæ¹æ³
ALTER TABLE `ãã¼ãã«å` AUTO_INCREMENT = 次ã®çªå·ã«ãããæ°å¤
MySQLã§idãªã©ã®ã«ã©ã ã®å¤ãæ¿å ¥æã«èªåçã«å¢ããã¦ããè¨å®ï¼ãªã¼ãã¤ã³ã¯ãªã¡ã³ãï¼ã«ãã¦ãããã¨ãå¤ãã§ãããã ãã¹ããªã©æ¿å ¥ããè¡ãåé¤ããå ´åããæ¯æãããçºçãã¦ãã¾ãã¾ãããããæ¹åããã®ãä¸è¨ã³ãã³ãã§ãã
ãã¨ãã°idã«ã©ã ã®å¤ã次ã®ããã«ãªã£ã¦ãããã6,7,8ããåé¤ããæ°ãã«è¡ãæ¿å ¥ããå ´å次ã®ããã«ãªãã¾ãã
id=1,2,3,4,5,6,7,8 âï¼æ¿å ¥ï¼ id=1,2,3,4,5,9
ããã§ã6,7,8ããåé¤ãããã¨ä¸è¨ã³ãã³ããå®æ½ãã¦ããã¨æ¯æãããªããªãã¾ãã
id=1,2,3,4,5,6,7,8 â ALTER TABLE `ãã¼ãã«å` AUTO_INCREMENT = 6 âï¼æ¿å ¥ï¼ id=1,2,3,4,5,6
1票ãããã¨æ¼ãã¦ä¸ããâªãã®ããã°ã®ã©ã³ãã³ã°ãå°ãä¸ããã¾ãã