title: How to convert two lists into adjacency matrix SQL Server T-SQL?
body: <p>I have table in SQL Server 2005 that contains two columns Fruit and Colour as shown below</p>
  
  <pre><code>Fruit          Colour
  Apple          Red
  Orange         Red
  Berry          Green
  PineApple      Green
  </code></pre>
  
  <p>Now i want to convert it into an adjacency matrix query
  as shown below</p>
  
  <pre><code>                Red        Green
  Apple           1          0
  Orange          1          0
  Berry           0          1
  PineApple       0          1
  </code></pre>
  
  <p>what i want to do is give 1 if Fruit and Colour are there 
  else i want to give a 0</p>