title: BigQuery - DELETE statement to remove duplicates
body: <p>There are plenty of great posts on SQL that selects unique rows and write  (truncates) a table so the dus are removed. e.g</p>
  <pre class="lang-sql prettyprint-override"><code>WITH ev AS (
    SELECT
      *,
      ROW_NUMBER() OVER (PARTITION BY id ORDER BY loadTime DESC) AS rowNum
    FROM `duplicates`
  )
  SELECT
    * EXCEPT(rowNum)
  FROM
    ev
  WHERE rowNum = 1
  </code></pre>
  <p>I was trying to explore this slightly differently using DML and <code>DELETE</code> (e.g if you don't want to use a BQ savedQuery, just execute SQL).  What I want to do is roughly:</p>
  <pre class="lang-sql prettyprint-override"><code>WITH dup_events AS (
    SELECT
      *,
      ROW_NUMBER() OVER (PARTITION BY id ORDER BY loadTime DESC) AS rowNum
    FROM `duplicates`
  )
  DELETE FROM
    dup_events
  WHERE rowNum &gt; 1
  </code></pre>
  <p>but got this error in the console:</p>
  <pre><code>Syntax error: Expected &quot;(&quot; or keyword SELECT but got keyword DELETE at [10:1]
  </code></pre>
  <p>Can this be achieved (standardSQL) using <code>DELETE</code>?</p>