Hi i'm trying to get a calculated field from mysql but i can't get it to work.
This is my query:
select name,
sum(if((id_action = '1' or id_action = '9' or id_action= '17'),1, 0)) as total_1,
sum(if((id_action = '20' or id_action = '7' or id_action = '15'),1, 0)) as total_2
group by name
Now, what i want is to get the sum of total_1 + total_2 but as they are already calculated ones i can't do: sum(total_1,total_2)
not evan (total_1 + total_2) because i get an error "Unknown colum total_1" any idea?
Thanks in Advance.