我想查詢使用大小寫的總標記列,並獲得各個等級的標記並將其存儲爲單獨的列。我一直在嘗試一段時間,但它一直給我錯誤。使用mysql時的情況
SELECT gradecalc.StudentId,gradecalc.CourseCode, Total,
CASE TOTAL
WHEN >90 THEN 'AA'
WHEN <90 AND >85 THEN 'BA'
WHEN <85 AND >=80 THEN 'BB'
WHEN <80 AND >=75 THEN 'CB'
WHEN <75 AND >=70 THEN 'CC'
WHEN <70 AND >=65 THEN 'DC'
WHEN <65 AND >=60 THEN 'DD'
ELSE 'FF'
END AS Grade
FROM GRADECALC GROUP BY gradecalc.StudentId,gradecalc.CourseCode
有什麼錯誤? – kerem
[文檔](https://dev.mysql.com/doc/refman/5.0/en/case.html)非常清晰。 –