- mysql> select * from roottb3;
- +----+----------+
- | id | rootdata |
- +----+----------+
- | 1 | aaa |
- | 3 | ddd |
- +----+----------+
- 2 rowsinset (0.00 sec)
- mysql> INSERT INTO `roottb3` (`id`,`data`) VALUES ('5', 'eeee'),('6', 'ffff');
- ERROR 1054 (42S22): Unknown column 'data'in 'field list'
- mysql> INSERT INTO `roottb3` (`id`,`rootdata`) VALUES ('5', 'eeee'),('6', 'ffff');
- Query OK, 2 rows affected (0.01 sec)
- Records: 2 Duplicates: 0 Warnings: 0
- mysql> select * from roottb3;
- +----+----------+
- | id | rootdata |
- +----+----------+
- | 1 | aaa |
- | 3 | ddd |
- | 5 | eeee |
- | 6 | ffff |
- +----+----------+
- 4 rowsinset (0.00 sec)
- mysql> delete from table roottb3 where rootdata = 'ffff';
- ERROR 1064 (42000): You have an errorinyour SQL syntax; check the manual that corresponds to your MySQL server versionforthe right
- syntax to use near 'table roottb3 where rootdata = 'ffff'' at line 1
- mysql> delete from roottb3 where rootdata = 'ffff';
- Query OK, 1 row affected (0.01 sec)
- mysql> select * from roottb3;
- +----+----------+
- | id | rootdata |
- +----+----------+
- | 1 | aaa |
- | 3 | ddd |
- | 5 | eeee |
- +----+----------+
- 3 rowsinset (0.00 sec)
- mysql>
来源: