hi i need help for query in DB::select my query is select i.customer_id, sum(i.point) as sm, c.first, c.last, (select count(id) from users where moaref_id = i.customer_id) as moaref, (sum(i.point)+(select count(id) from users where moaref_id = i.customer_id)) as total from invoice i inner join users c ON c.id = i.customer_id left outer join users m ON m.id = c.moaref_id group by i.customer_id order by moaref desc