修复MySQL错误1064(42000),请检查与您的MySQL服务器版本相对应的手册,以获取在')'附近使用的正确语法
如果您使用了不正确的语法,则可能会发生此错误。假设以下是createtable语句-
mysql> create table DemoTable1492 -> ( -> timestamp TIMESTAMP, -> event int, -> ); 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 ')' at line 5
您需要在事件列之后删除上面的多余逗号以进行修复。让我们首先创建一个-
mysql> create table DemoTable1492 -> ( -> timestamp TIMESTAMP, -> event int -> );
使用insert在表中插入一些记录-
mysql> insert into DemoTable1492 values(now(),101); mysql> insert into DemoTable1492 values(now()+interval 3 month,102);
使用选择命令显示表中的所有记录-
mysql> select * from DemoTable1492;
这将产生以下输出-
+---------------------+-------+ | timestamp | event | +---------------------+-------+ | 2019-10-06 10:56:53 | 101 | | 2020-01-06 10:57:07 | 102 | +---------------------+-------+ 2 rows in set (0.00 sec)
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短