title: How to pivot table for year in SQL?
body: <p>I have a query </p>
  
  <pre><code>SELECT mua.Id,tnk.Plate,Cast(mua.Tarih as Date) as M_Date
  FROM Muayene mua 
  LEFT JOIN Tanker tnk on (tnk.OID=mua.TankerId)
  ORDER BY mua.Id DESC
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Inujt.jpg" alt="enter image description here"></p>
  
  <p>But I need result to be </p>
  
  <pre><code>      Id    Plate         2011         2012   2013  2014   2015   2016        2017
        5     34VM7969      2011-08-02                               
        4     34VM7969                                               2016-08-19
        3     34VM7969                                                          2017-03-19
        1     34VM7969                               2014-08-08
  </code></pre>
  
  <p>How can I change my query for this result ? </p>