title: SQL for DB2 - Comparing a column with itself with values from different years
body: <p>I am trying to compare a column (which has numeric values) to itself but for a different year (from the same table)</p>
  
  <p>My query reads something like this:</p>
  
  <pre><code>SELECT  
      CYData.Column1, CYData.Column2, CYData.Year,     
      PYData.Column1,PYData.Column2, PYData.Year
  FROM
      DB1.Table1 CYData
  INNER JOIN
      DB1.Table1 PYData ON CYData.Column1 = PYData.Column1
                        AND CYData.Year = 2013
                        AND PYData.Year = 2012;
  </code></pre>
  
  <p>Is this an efficient query? It seems to crash the server. What is a better way of doing this?</p>