title: BigQuery Standard SQL count original rows after CROSS JOIN UNNEST
body: <p>I have a table with a repeated field that requires a <code>CROSS JOIN UNNEST</code> and I want to be able to get the count of the original, nested rows.  For example.</p>
  
  <pre><code>SELECT studentId, COUNT(1) as studentCount
  FROM myTable
  CROSS JOIN UNNEST classes
  WHERE classes.id in ('1', '2')
  </code></pre>
  
  <p>Right now, if a student is in class 1 and 2 it will count that student twice in <code>studentCount</code>.</p>
  
  <p>I know I can do <code>count(distinct(student.id))</code> to workaround this, but this ends up being a lot slower than a simple count.  It's not taking advantage of the fact there's exactly one row per student.</p>
  
  <p>So is there any way to compute count of the original rows before unnesting (but after the where clause) but still include the unnest in the query?</p>
  
  <p>Note this must be in Standard SQL.</p>