Mysql Select Subquery where clause subquery equal alias ( AS subquery named )
You can try this

with t1 as (
select id, name,
(select count(tableB.id) from tableB where tableB.id_tableA = tableA.id) as 
haveBonA,
(select count(tableC.id) from tableC where tableC.id_tableA = tableA.id) as 
haveConA
from tableA
)

select t1.*,
   case
   when t1.haveBonA = t1.haveConA then "Equal"
   else "Not Equal"
   end equalTableBTableC
from t1
where 1=1