title: How can I this so only the best performing company is shown for each year?
body: <p>I've been working on this single SQL statement for a couple of days now &amp; I can't seem to get this done.
  With some help from friends/family, I managed to get the statement close to completion, but there's a vital part still missing &amp; I can't figure out how to do this exactly.</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>SELECT DISTINCT 
      T1.Jaar, 
      T1.CompanyName, 
      CONCAT('€ ', CONVERT(money,T1.Kost)) AS 'Hoogste Prijs'
  FROM 
      (
      SELECT  
          Year(OrderDate) AS 'Jaar',
          CompanyName,
          SUM(Freight) AS 'Kost'
      FROM Orders
      JOIN Shippers S ON ShipVia = S.ShipperID
      GROUP BY YEAR(OrderDate), CompanyName
      ) T1
  LEFT JOIN 
      (
      SELECT  
          Year(OrderDate) AS 'Jaar',
          CompanyName,
          SUM(Freight) AS 'Kost'
      FROM Orders
      JOIN Shippers S ON ShipVia = S.ShipperID
      GROUP BY YEAR(OrderDate), CompanyName
      ) T2 ON T1.CompanyName = T2.CompanyName
  ORDER BY Jaar
  </code></pre>
  
  <p>Which returns me the following resultset:
  <img src="https://i.stack.imgur.com/x6ruY.png" alt="Resultset"></p>
  
  <p>Now, for the part that I can't figure out:
  Using the above statement, I need to expand it so that I only get the highest value for "Hoogste Prijs" for each year.
  So in the end, my resultset should look like this:</p>
  
  <pre><code>+------+------------------+---------------+
  | Jaar |   CompanyName    | Hoogste Prijs |
  +------+------------------+---------------+
  | 1996 | Federal Shipping | € 4233.78     |
  | 1997 | United Package   | € 12374.04    |
  | 1998 | United Package   | € 12122.14    |
  +------+------------------+---------------+
  </code></pre>
  
  <p>From what I understand, I shouldn't be far off from the solution, but I can't seem to find it at all.</p>