title: SQL query to count frequency
body: <p>I've got a table which has entries like</p>
  
  <pre><code>id     keywords
  1      cat, dog, man, mouse
  2      man, pen, pencil, eraser
  3      dog, man, friends
  4      dog, leash,......
  </code></pre>
  
  <p>I want to make a table something like</p>
  
  <pre><code>id  cat  dog  man  mouse  pen  pencil  eraser  friends  leash ......
  1   1    1    1    1      0    0       0       0        0
  2   0    0    1    0      1    1       1       0        0
  3   0    1    1    0      0    0       0       1        0
  </code></pre>
  
  <p>and so on.</p>