gpt4 book ai didi

mysql - SQL 语法错误 - #1064 - 您的 SQL 中有错误

转载 作者:行者123 更新时间:2023-11-30 00:19:38 25 4
gpt4 key购买 nike

我确信这很简单,但我无法弄清楚。我收到此错误:

#1064 - 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 'KEY ID ( id , gets_mail ), `KEY email_addr ( email_addr ), ) ENGINE=MyISA' at line 9

在以下代码中:

 CREATE TABLE `ijgresearch`.`wp_post_notification_emails` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`email_addr` VARCHAR( 255 ) DEFAULT NULL ,
`gets_mail` INT( 11 ) DEFAULT NULL ,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`date_subscribed` DATETIME DEFAULT NULL ,
`act_code` VARCHAR( 32 ) DEFAULT NULL ,
`subscribe_ip` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' ,
`PRIMARY KEY ( ` id ` ),
`KEY ID ( ` id ` , ` gets_mail ` ),
`KEY email_addr ( ` email_addr ` ),
) ENGINE=MyISAM DEFAULT CHARSET=latin1;`

经过几个小时的尝试不同的事情后,我还是无法做到正确。有什么想法吗?

最佳答案

反引号太多

CREATE TABLE `ijgresearch`.`wp_post_notification_emails` 
(
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`email_addr` VARCHAR( 255 ) DEFAULT NULL ,
`gets_mail` INT( 11 ) DEFAULT NULL ,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`date_subscribed` DATETIME DEFAULT NULL ,
`act_code` VARCHAR( 32 ) DEFAULT NULL ,
`subscribe_ip` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' ,
PRIMARY KEY ( id ),
KEY ID ( id ,gets_mail ),
KEY email_addr ( email_addr )
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

最后一个之前有太多逗号)

关于mysql - SQL 语法错误 - #1064 - 您的 SQL 中有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23338860/

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