gpt4 book ai didi

mysql 枚举错误 : 1067 what is the mistake?

转载 作者:太空宇宙 更新时间:2023-11-03 11:10:04 25 4
gpt4 key购买 nike

Errore
query SQL:

CREATE TABLE `hospital_jqm`.`users` (

`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 80 ) NOT NULL ,
`surname` VARCHAR( 80 ) NOT NULL ,
`address` VARCHAR( 80 ) NOT NULL ,
`birth_place` VARCHAR( 50 ) NOT NULL ,
`province` VARCHAR( 5 ) NOT NULL ,
`birth_date` DATE NOT NULL ,
`sex` ENUM( 'male', 'female' ) NOT NULL DEFAULT '''male''',
`case` ENUM( 'politrauma', 'cardiologico', 'neurologico' ) NOT NULL DEFAULT '''politrauma'''
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

Messaggio di MySQL:

#1067 - Invalid default value for 'sex'

我尝试创建此表但收到此错误。为什么?错误在哪里?

最佳答案

'''male''' 应该是 'male'

关于mysql 枚举错误 : 1067 what is the mistake?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9219630/

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