Skip to content

Instantly share code, notes, and snippets.

@mze3e
Created August 7, 2021 17:42
Show Gist options
  • Save mze3e/b48d9b48e8e69954f96623b4cb78ed97 to your computer and use it in GitHub Desktop.
Save mze3e/b48d9b48e8e69954f96623b4cb78ed97 to your computer and use it in GitHub Desktop.
Google BigQuery De Duplication
CREATE OR REPLACE TABLE `amazon_products.amazon_products`
AS
Select asin, brand, title, feature, description, price, image, also_buy, also_view, rank, category, similar_item, tech1, tech2, fit, main_cat, details from (
SELECT asin, brand, title, feature, description, price, image, also_buy, also_view, rank, category, similar_item, tech1, tech2, fit, main_cat, details,
ROW_NUMBER() OVER ( PARTITION BY asin ORDER BY asin ) AS rownum
FROM `amazon_products.amazon_products_latest`) A
where A.rownum=1
order by asin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment