Write a query to retrieve the most valuable customer of each year. The most valuable customer of a year is the customer
Posted: Fri Jul 01, 2022 5:42 am
Write a query to retrieve the most valuable customer of each year. The most valuable customer of a year is the customer who has made the most purchase for the year.Use the yearly sum of theTotalDue column in SalesOrderHeader as a customer's total purchasefor a year. If there is a tie for the most valuable customer,your solution should retrieve it.Include the customer's id, total purchase, and total order countfor the year. Display the total purchase as an integer using CAST.Sort the returned data by the year.