gpt4 book ai didi

mysql - 损坏的插入语句

转载 作者:行者123 更新时间:2023-11-29 06:34:22 25 4
gpt4 key购买 nike

这个插入语句有什么问题?我看了好几遍了,也没看出哪里不对。

INSERT INTO tasks
(task_id, priority, limit, total_active, time_limit, start_time, params)
VALUES ("d", "9", "1", "0", "1549699912", "1549696366", "");
+--------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| task_id | varchar(2) | NO | | NULL | |
| priority | tinyint(1) | NO | | 0 | |
| limit | int(11) | NO | | NULL | |
| total_active | int(11) | NO | | NULL | |
| time_limit | int(11) | NO | | NULL | |
| start_time | int(11) | NO | | NULL | |
| params | tinytext | YES | | NULL | |
+--------------+------------+------+-----+---------+----------------+

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 'limit, total_active, time_limit, start_time, params) VALUES ("1", "d", "9", "1",' at line 1

最佳答案

LIMIT 是sql中的关键字,需要在其周围添加双引号。

INSERT INTO tasks(task_id, priority, "limit", total_active, time_limit, 
start_time, params) VALUES ("d", "9", "1", "0", "1549699912", "1549696366", "");

编辑:如果这不起作用,您可以使用反引号进行转义:

INSERT INTO tasks(task_id, priority, `limit`, total_active, time_limit, 
start_time, params) VALUES ("d", "9", "1", "0", "1549699912", "1549696366", "");

关于mysql - 损坏的插入语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54604198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com