Skip to content

Instantly share code, notes, and snippets.

@mze3e
mze3e / google-bigquery-de-duplication.sql
Created August 7, 2021 17:42
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