我有一个关于在已经创建的表中插入行的问题。
这是我的表:
mysql> describe llx_document_model ;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| rowid | int(11) | NO | PRI | NULL | auto_increment |
| nom | varchar(50) | YES | MUL | NULL | |
| entity | int(11) | NO | | 1 | |
| type | varchar(20) | NO | | NULL | |
| libelle | varchar(255) | YES | | NULL | |
| description | text | YES | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
如果我打印表格:
mysql> select * from llx_document_model ;
+-------+----------+--------+-------------------+---------+-------------+
| rowid | nom | entity | type | libelle | description |
+-------+----------+--------+-------------------+---------+-------------+
| 1 | standard | 1 | deplacement | NULL | NULL |
| 7 | soleil | 1 | ficheinter | NULL | NULL |
| 13 | rouget | 1 | shipping | NULL | NULL |
| 14 | typhon | 1 | delivery | NULL | NULL |
| 16 | aurore | 1 | supplier_proposal | NULL | NULL |
| 17 | muscadet | 1 | order_supplier | NULL | NULL |
| 18 | baleine | 1 | project | NULL | NULL |
| 19 | einstein | 1 | order | NULL | NULL |
| 21 | azur | 1 | propal | NULL | NULL |
| 23 | strato | 1 | contract | strato | NULL |
| 32 | crabe | 1 | invoice | crabe | NULL |
+-------+----------+--------+-------------------+---------+-------------+
11 rows in set (0.00 sec)
我想添加一行,所以我写道:
mysql> INSERT INTO llx_document_model
-> VALUES(NULL, moriba, 1, invoice, moriba, NULL);
但是我收到了这个错误:
ERROR 1054 (42S22): Unknown column 'moriba' in 'field list'
你对我的问题有所了解吗?我没有看到我在哪里犯了错误。
提前谢谢你!
答案 0 :(得分:1)
字符串应该用(')单引号括起来
mysql> INSERT INTO llx_document_model VALUES(NULL, 'moriba', 1, 'invoice', 'moriba', NULL);