Using a calculated value in a WHERE clause

I have a query with a calculated value:

AY_score + CG_score + GR_score + GT_score  as judges_score

Is it possible to use the judges_score value in the WHERE clause?

I just would like to filter to show results where judges_score > 0, but using:

WHERE judges_score > 0 

Is giving me the error: Unknown column ‘judges_score’ in ‘where clause’.

Thank you.

EDIT - sorry - realised I could just use:

(AY_score + CG_score + GR_score + GT_score  > 0)

In MySQL you can also use HAVING instead of WHERE to filter with alias

HAVING judges_score > 0

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.