use examples /* Method 1 - Sub-Queries */ select active, paid, count(*) as users from ( select conv_rate.*, active from ( select signed_up.* , case when (paid.username is not null) then 1 else 0 end as paid from ( select * from subscriptions where plan_id = 0 and year(subscription_start)*100+month(subscription_start) = 201411 ) signed_up left join ( select subs.* from ( select * from subscriptions where plan_id > 0 ) subs join ( select username , min(subscription_start) as first_sub from subscriptions where plan_id>0 group by username ) first_sub on subs.username = first_sub.username and subs.subscription_start = first_sub.first_sub ) paid on signed_up.username = paid.username ) conv_rate left join ( select su.username , max(case when (se.session_start between su.subscription_start and dateadd(dd,14,su.subscription_start)) then 1 else 0 end) as active from subscriptions su left join sessions se on su.username = se.username where su.plan_id = 0 group by su.username ) was_active on conv_rate.username = was_active.username ) final_data group by active, paid order by active, paid