1You can not use aliased columns in a WHERE clause. You can try using a derived
2table. Perhaps something like this (sorry, not tested):
3
4select tblProgram.POIname from tblProgram
5where
6 -- Use this if you only want to filter by the value.
7 (select count(*) as alias_name from `fb_promo_codes_used`) < 2