title: How to remove duplicate rows in Google BigQuery based on a unique identifier
body: <p>In SQL, I use the following code to remove duplicates from a table based on a unique ID:</p>
  
  <pre><code>1. SELECT Unique_ID INTO holdkey FROM [Origination] GROUP BY Unique_ID HAVING count(*) &gt; 1
  
  2. SELECT DISTINCT Origination.*
  INTO holddups
  FROM [Origination], holdkey
  WHERE [Origination].Unique_ID = holdkey.Unique_ID
  
  3. DELETE Origination 
  FROM Origination, holdkey
  WHERE Origination.Unique_ID = holdkey.Unique_ID
  
  4. INSERT Origination SELECT * FROM holddups  
  </code></pre>
  
  <p>The second process does not work on BigQuery. Regardless of how I change the query, I get errors for unrecognized columns and tables.</p>
  
  <p>I obviously take out "select into" queries and just set the destination tables manually. I have SQL experience, and I know the process works. Does anyone have a sample of syntax that they use for the process of removing duplicate records based on a unique ID for BQ? Or a way to modify this that would make it run? </p>