title: How to create a pivot query in SQL Server with CASE Statement?
body: <p>Col1 contains only X and Y.</p>
  
  <pre><code>Col1    Col2
  
  X       abc
  
  Y       pqr
  
  X       pqr
  
  X       mnq
  
  Y       cxr
  </code></pre>
  
  <p>I want to make it like this:</p>
  
  <pre><code>X    Y    Col2
  
  Yes  Yes  pqr
  Yes  No   abc
  Yes  No   mnq
  No   Yes  cxr
  </code></pre>
  
  <p>What SQL Query i should write?</p>