I have a table in mySQL with the following columns:
CUSTOMER_CODE | TRANS_TYPE | TRANS_VALUE
TRANS_TYPE could be either \"DRINV\" (a sale) or \
select customer_code, sum(case when trans_type = 'DRINV' then trans_value else -trans_value end) as net_sales from dr_trans group by customer_code