php - MySQL 5.5 大小写不正确的语法

标签 php mysql syntax

嘿,我无法让这个 case 语句起作用,有人介意告诉我语法有什么问题吗?

SELECT standards.standard_id, standards.title, standards.level,standards.credits, SUM(standards.credits), standards.assessment 

CASE  WHEN standards.assessment = 1 THEN 'External' ELSE 'Internal' END CASE
FROM standards JOIN courses_standards ON standards.standard_id = courses_standards.standard_id 
WHERE courses_standards.course_id = 1

准确的错误是:

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 'CASE WHEN standards.assessment = 1 THEN 'External' ELSE 'Internal' END CASE FR' at line 3

最佳答案

您在 standards.assessmentCASE 之间漏掉了一个逗号

关于php - MySQL 5.5 大小写不正确的语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32622570/

相关文章:

php - 如何使用wordpress自定义元素?

php - 如果 else 语句返回两个而不是一个?

mysql - SQL 按字符串计数不正确

bash - Bash 中不区分大小写的比较

c++ - 我无法弄清楚 C++ 语法错误 "expected ` ;' before ‘{’ token ”

php - 需要将值从 PHP 传递到 Javascript

php - Silex 安全提供商

java - MySQL InnoDB 在等待表级锁时挂起

php - MySql 中 Oracle 序列的替代方案

google-chrome - Chrome 开发者控制台无法运行 JS 循环