title: bigQuery - how to use row values to create columns for a new table
body: <p><strong>I have the following genomic table (over 12K rows) in BigQuery. A long list of the PIK3CA_features (column 2) are related to the same sample_id (column 1)</strong></p>
  
  <pre><code>Row sample_id   PIK3CA_features  
  1   hu011C57    chr3_3930069__TGT    
  2   hu011C57    chr3_3929921_TC  
  3   hu011C57    chr3_3929739_TC  
  4   hu011C57    chr3_3929813__T  
  5   hu011C57    chr3_3929897_GA  
  6   hu011C57    chr3_3929977_TC  
  7   hu011C57    chr3_3929783_TC  
  </code></pre>
  
  <p><strong>I would like to generate the following table:</strong></p>
  
  <pre><code>Row sample_id   chr3_3930069__TGT   chr3_3929921_TC chr3_3929739_TC
  1   hu011C57    1                   1               0
  2   hu011C58    0    
  </code></pre>
  
  <p>Meaning, one row for every sample ID and a 1/0 if the PIK3CA_feature exist at this sample.</p>
  
  <p>Any idea how to easily generate this table?</p>
  
  <p>Many thanks for any idea!</p>