我的查詢有問題,有什麼問題?MySQL病例聲明 - 未知列在哪裏
SELECT
CASE
WHEN cp_pessoa.score < 100 THEN 1
WHEN cp_pessoa.score < 300 THEN 2
WHEN cp_pessoa.score >= 300 THEN 3
END as id_ranking
FROM cp_pessoa
WHERE id_ranking IN (1,2);
我得到這個錯誤:#1054 - 在未知列'id_ranking 'where子句'
謝謝!
哪裏犯規看到別名。 – Mihai