title: BigQuery Standard SQL Pivot Rows to Columns
body: <p>Im trying to query data that uses rows to store time series data using Standard SQL in BigQuery. Example data below.  There will be way more Jobs than A-D</p>
  
  <pre><code>+-----+------------+--------------+-----------+
  | Job | BatchDate  | SuccessCount | FailCount |
  +-----+------------+--------------+-----------+
  | A   | 2018-01-01 |           35 |         1 |
  | A   | 2018-01-07 |           13 |         6 |
  | B   | 2018-01-01 |           12 |        23 |
  | B   | 2018-01-07 |           67 |        12 |
  | C   | 2018-01-01 |            9 |         4 |
  | C   | 2018-01-07 |           78 |         6 |
  | D   | 2018-01-01 |            3 |        78 |
  | D   | 2018-01-07 |           99 |         5 |
  +-----+------------+--------------+-----------+
  </code></pre>
  
  <p>I would like to have the following as output but cannot work out how to accomplish this in BigQuery. </p>
  
  <p>SuccessCount values in column</p>
  
  <pre><code>+-----+------------+--------------+
  | Job | 2018-01-01 | 2018-01-07   |
  +-----+------------+--------------+
  | A   |         35 |           13 |
  | B   |         12 |           67 |
  | C   |          9 |           78 |
  | D   |          3 |           99 |
  +-----+------------+--------------+
  </code></pre>
  
  <p>Is this sort of thing possible with BigQuery?  Can anyone provide a working example?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The data will grow over time, with new entries for each job per week.  Is there a way to do this without having to hard code each BatchDate as a column?</p>