title: Converting a table to matrix of 0's and 1's
body: <p>I have a table of Hosts and event Id's Like</p>
  
  <pre><code>Hosts     |   Event_id
  system1          1
  System2          1
  System1          2
  System3          1
  System2          2
  </code></pre>
  
  <p>etc.</p>
  
  <p>Now I want to convert them into a matrix like</p>
  
  <pre><code>             |  1    2    3    4    5    6    7    8    9 ....
  ---------------------------------------------------------------------
      System1  |  1    1    0    1    1    0    1    0    0 ....
      System2  |  1    1    1    1    1    0    1    0    0 ....
      System3  |  1    0    0    1    1    0    1    0    0 ....
  </code></pre>
  
  <p>How to do it in SQL?</p>