1. I want to ouput ALL of the CustomerName with their SalesValue and the Province
Select CustomerName,SalesValue,Province into #Temp
2. and then, the tricky part for me: view the total sales for each Province the customer has made in each Province.
Select CustomerName,Province ,Sum(SalesValue)from tbl_Name a
inner join #Temp b on a.CustomerValue=b.CustomerValue
group by CustomerName,Province