I have three SQL selects, the results of which I need to add together. Two of the three use fairly complex joins.
select sum(field_one) from t_a join t_b on (t_a.bid = t_b.id) where t_b.user_id=:id
select sum(field_two) from t_c join t_d on (t_c.did = t_d.id) where t_d.user_id=:id
select sum(field_three) from t_e where t_e.user_id=:id
What I need is the sum of all three values. sum(field_one)+sum(field_two)+sum(field_three)
. Is there anyway to do this in a single statement?