Q:

Can i add sum into another sum using only alias in mysql

I have a statement like this where i need to combine multiple alias as another sum and get an output. 
select 
t1.id,
sum(t2.answ = t1.answ) as answerA,
sum(t3.answ = t1.answ) as answerM,
sum(t4.answ = t1.answ) as answerD,
sum(answerA + answerM + answerD) as total
from t1
left join t2 on t2.id = t1.t2fk
left join t3 on t3.id = t1.t3fk
left join t4 on t4.id = t1.t4fk
group by t1.id // updated

Is this possible?   
sum(answerA + answerM + answerD) as total

A:

No, you can't refer to a column alias in the same query.  You would have to make it a subquery. 
SELECT id, answerA, answerB, answerC, (answerA + answerM + answerD) AS total
FROM (
    select 
        t1.id,
        sum(t2.answ = t1.answ) as answerA,
        sum(t3.answ = t1.answ) as answerM,
        sum(t4.answ = t1.answ) as answerD,
        sum(answerA + answerM + answerD) as total
    from t1
    left join t2 on t2.id = t1.t2fk
    left join t3 on t3.id = t1.t3fk
    left join t4 on t4.id = t1.t4fk
    GROUP BY t1.id
) AS subquery

or you can write an expression that's equivalent. 
select 
    t1.id,
    sum(t2.answ = t1.answ) as answerA,
    sum(t3.answ = t1.answ) as answerM,
    sum(t4.answ = t1.answ) as answerD,
    sum(t1.answ IN (t2.answ, t3.answ, t4.answ)) as total
from t1
left join t2 on t2.id = t1.t2fk
left join t3 on t3.id = t1.t3fk
left join t4 on t4.id = t1.t4fk
GROUP BY t1.id

