데이터베이스/Mysql
Mysql 데이터값 자동증가
왕왕왕왕
2015. 7. 3. 09:40
버전올라가기전
create table 테이블명 (num int(11) not nulll default '0' auto_increment);
- default '0' 기본값 0부터시작하게 함
- auto_increment 기본값부터 1씩 레코드 입력될 때 마다 증가시킴
!! mysql 버전올라가면서 default값 넣는게 사라짐
버전올라간 후
create table 테이블명 (num int(11) not nulll auto_increment);
- auto_increment 디폴트값없이 자동증가만 넣어주면됨