parse error: unknown column

I have a uint field blacklist_id and I would like know is field more the zero. So my code for chek:
SELECT IF(blacklist_id>0,1,0) AS blacklist_id, COUNT(*) AS count FROM responseIndex;

But I see
ERROR 1064 (42000): index responseIndex: parse error: unknown column: blacklist_id
I don’t understand why show me this error message because there is such a field blacklist_id.
describe IndaxeName showed me blacklist_id field

How to solve this question?

use different alias name to not shadow blacklist_id like
SELECT IF(blacklist_id >0,1,0) AS bid , COUNT(*) AS count FROM responseIndex ;

1 Like