嘿,我无法让这个 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.assessment
和 CASE
之间漏掉了一个逗号
关于php - MySQL 5.5 大小写不正确的语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32622570/