gpt4 book ai didi

sql - mysql比较枚举

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

这是我的 table

CREATE TABLE `CUSTOMERSTATUSTYPES` (
`CustomerStatusId` int(1) unsigned NOT NULL auto_increment,
`CustomerStatusName` enum('ACTIVE','SUSPEND','TERMINATE','CANCEL') default NULL,
PRIMARY KEY (`CustomerStatusId`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

当我写作时

GROUP BY ... WHERE cst.CustomerStatusName<>'TERMINATE' ;

语法错误

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 'WHERE cst.CustomerStatusName<>'TERMINATE'' at line 1

我如何正确检查这个?

最佳答案

WHERE 子句必须在 GROUP BY 子句之前。

关于sql - mysql比较枚举,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1649742/

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