gpt4 book ai didi

mysql - phpmyadmin/创建表/语法错误/枚举

转载 作者:行者123 更新时间:2023-11-29 14:15:27 27 4
gpt4 key购买 nike

I have searched, but frustratingly have been unable to figure out why I am getting this error on the following SQL statement.

错误:#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 5 行的 ''kidney_renal_diaanalysis' enum('Yes','UnderTreat','No','Ref') not NULL, 'liver_c' 附近使用的正确语法

SQL语句:>

CREATE TABLE `client_health_info` (
`client_id` int(11) NOT NULL PRIMARY KEY,
`ER_visits_3_months` int(2) NOT NULL,
`hospitilizations_last_year` int(2) NOT NULL,
'kidney_renal_dialysis' enum('Yes','UnderTreat','No','Ref') not NULL,
'liver_cirr_ES_liver' enum('Yes','UnderTreat','No','Ref') not NULL,
'HCAH' enum('Yes','UnderTreat','No','Ref') not NULL,
'hiv_aids' enum('Yes','UnderTreat','No','Ref') not NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB not CHARSET=latin1;

最佳答案

您使用了错误的引号! ;-)

CREATE TABLE `client_health_info` (
`client_id` int(11) NOT NULL PRIMARY KEY,
`ER_visits_3_months` int(2) NOT NULL,
`hospitilizations_last_year` int(2) NOT NULL,
`kidney_renal_dialysis` enum('Yes','UnderTreat','No','Ref') not NULL,
`liver_cirr_ES_liver` enum('Yes','UnderTreat','No','Ref') not NULL,
`HCAH` enum('Yes','UnderTreat','No','Ref') not NULL,
`hiv_aids` enum('Yes','UnderTreat','No','Ref') not NULL
) ENGINE=InnoDB, CHARSET=latin1;

编辑:修复了另外两个错误:重复的 PRIMARY KEY 语句和 CHARSET 之前的 NOT

关于mysql - phpmyadmin/创建表/语法错误/枚举,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12773252/

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