gpt4 book ai didi

phpmyadmin - 我的代码不会创建表

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

尝试使用 PhpMyadmin 创建表时,我不断收到语法错误。

我做错了什么?

CREATE TABLE `cust`
(
`cust5_id` Integer auto_increment primary key,
`prog_id` Integer not null,
`cust_no` Integer null,
`balance` Integer - accept negative and positive numbers
)


INSERT INTO `cust`
(`cust5_id`,`prog_id`,`cust_no`,`balance`)
VALUES
(1,217770,145094,-178.01),
(2,219885,145113,-390.86),
(3,219888,145164,-206.55),
(4,226227,145279,0),
(5,227700,145340,0),
(6,219911,145344,0),
(7,227795,145410,-44.1),
(8,227796,145472,0),
(9,219919,145481,0),
(10,225616,145604,0),
(11,219942,145668,0),
(12,219943,145682,0),
(13,219966,145694,0),
(14,219973,145731,-210.6),
(15,219977,145782,0)

编辑:更改:

删除了末尾的逗号,没有区别。

错误代码始终为#1064,或者如果我稍微编辑它,“-###”条目就会出现问题。

最佳答案

您的评论需要两个尾随连字符:

CREATE TABLE `cust`
(
`cust5_id` Integer auto_increment primary key,
`prog_id` Integer not null,
`cust_no` Integer null,
`balance` Integer -- accept negative and positive numbers
);

create table in phpmyadmin

并且您需要在插入内容末尾使用分号而不是逗号:

INSERT INTO `cust`
(`cust5_id`,`prog_id`,`cust_no`,`balance`)
VALUES
(1,217770,145094,-178.01),
(2,219885,145113,-390.86),
(3,219888,145164,-206.55),
(4,226227,145279,0),
(5,227700,145340,0),
(6,219911,145344,0),
(7,227795,145410,-44.1),
(8,227796,145472,0),
(9,219919,145481,0),
(10,225616,145604,0),
(11,219942,145668,0),
(12,219943,145682,0),
(13,219966,145694,0),
(14,219973,145731,-210.6),
(15,219977,145782,0);

inserts in phpmyadmin

关于phpmyadmin - 我的代码不会创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15483120/

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