drop table tt;
create table tt(
id int(3) not null auto_increment,
name varchar(20),
primary key(id) 
);
insert into tt('id','name') values('0','www');
执行上边的代码,出现下边的错误,我的是msql5.0版本,搜索没找到答案,往高人指点
mysql> insert into tt('id','name') values('0','www');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ''id',
'name') values('0','www')' at line 1

解决方案 »

  1.   

    mysql> insert into tt('name') values('www'); 这样就行,自增列不要插入
      

  2.   

    楼上正解.
        [align=center]====  ====
    [/align]
    .
    贴子分数<20:对自已的问题不予重视。
    贴子大量未结:对别人的回答不予尊重。
    .
      

  3.   

    mysql> insert into tt(name) values('www'); 
      

  4.   

    这条语句我测试过,在mysql5.0是行不通的,不知道兄台是在哪个环境下测试成功的。