Tuesday 15 April 2014

sql - What's wrong with the following INSERT IGNORE MySQL syntax? -


The following create table statement is valid, and it is working properly: The 'primary' key, 'A' varchar (100) not zero, 'B' varchar (100), zero '', 'pid' varchar (100) C 'Varchar (100),' D 'varchar (100),' e 'varchar (100));

However, I get an invalid MySQL syntax error for the following INSERT IGNORE statement:

  INSERT in IGNORE Table 1 ('ABC', 'ABC 123', 'ABC', 'ADE', 'ABC', 'ACE', 'A', 'P', 'A', 'B', 'C', ' I also tried:  
  INSERT Table 1 (ID, PID, A, B, C, D, D ',' 12345 ');   E) values ​​(150, 'ABC 123', 'ABC', 'ADE', 'ABC', 'AE', '12345');    

Single quote for your column names Be sure to use brackets instead of:

  make table table 1 (`id` is not integer, 'pid' varchar (100) null primary key,` a 'varchar (100) The value (150, 'ABC 123', 'ABC', 'Z', 'B' varchar (100) zero, `c 'varchar (100),` d' varchar (100), `e 'varchar (100) 'AED', '' ADE '', 'Table' (`id`,` pid`, `a`````````````````````` e 'ABC', 'AE', '12345 ');   



No comments:

Post a Comment