sql query to sum of same id but different value??....
I am trying to calculate sum of same id...following is my table
from add_to_cart as a
sum(prod_barter_val) as total
from add_to_cart group by buyer_id) as b
on a.buyer_id = b.buyer_id;
You can just do like:
select buyer_id, sum(prod_barter_val) from add_to_cart group by buyer_id