有默认值了,该字段就不用插入了. 例如字段1,字段2,字段3,一共3个,其中字段1是默认的。 应该这样: insert into table (字段2,字段3)values("1","2"); 如果你这样:insert into table values("1","2"); 或是insert into table ("1","2"); 就会有问题。
insert into table (字段2,字段3)values("1","2");
切记 insert into tableName 后面要加参数列表insert into tableName([fieldName],[fieldName],...) values([fieldName],[fieldName],...)orinsert into tableName([fieldName],[fieldName],...) select [fieldName],[fieldName],... from otherTableName
例如字段1,字段2,字段3,一共3个,其中字段1是默认的。
应该这样:
insert into table (字段2,字段3)values("1","2");
如果你这样:insert into table values("1","2");
或是insert into table ("1","2");
就会有问题。
后面要加参数列表insert into tableName([fieldName],[fieldName],...) values([fieldName],[fieldName],...)orinsert into tableName([fieldName],[fieldName],...) select [fieldName],[fieldName],... from otherTableName