I'm writing a view that has 2 tables: One table has customer information, the other has sales data (detail). I'm trying to return data in columns that sums all sales data by customer for the past 5 fiscal years. I'm easily able to accomplish this in a row format, but each customer has 5 rows...one row for each fiscal year.
My ideal would be to create the following format: Customer name, 2015 sales, 2014 sales, 2013 sales, etc. All in one record.
Can anyone point me in a direction on how to do this vs. return each year in individual rows (using group by)?
Thanks,
Troy