SELECT id, firstname, lastname, is_online, adate, photo, rdate, ( select count(*) from instance2_interests_users b where b.uid = a.id and b.`is_deleted` = 0 ) as fg FROM `instance24_users` a WHERE fg > 0 and a.`is_deleted` = 0 ORDER BY `rdate` asc
Why does this error occur?
Unknown column 'fg' in 'where clause'