June 07, 2020
SQL ‘Group by’ example
Example:
Find all the cost of acquiring a customer of customer type ‘business’
Select sum(cost), cust_type
From sales_table
where cust_type = ‘business’
group by cust_type