@kommy_jp Facebook: kohei.komiyama Blog: https://zenn.dev/kommy339 Snowflake 2023 Snowflake Data Superheroes Title Data Management Team Manager Data Engineer Magic: The Gathering Body-building Escape game Hobbies Interests
JOIN link_sales_product lsp ON hs.sales_h_key = lsp.sales_h_key INNER JOIN hub_products hp ON hp.product_h_key = lsp.product_h_key INNER JOIN sat_sales ss ON hs.sales_h_key = ss.sales_h_key INNER JOIN sat_products sp ON sp.product_h_key = hp.product_h_key WHERE sat_sales.loaded_at = (select max(loaded_at) from sat_sales) AND sat_products.loaded_at = (select max(loaded_at) from sat_products) ;
JOIN link_sales_product lsp ON hs.sales_h_key = lsp.sales_h_key INNER JOIN hub_products hp ON hp.product_h_key = lsp.product_h_key INNER JOIN sat_sales ss ON hs.sales_h_key = ss.sales_h_key INNER JOIN sat_products sp ON sp.product_h_key = hp.product_h_key WHERE sat_sales.loaded_at = (select max(loaded_at) from sat_sales) AND sat_products.loaded_at = (select max(loaded_at) from sat_products) ; ディメンショナルモデルだったらJOINが1つで良かったこと をJOINが4つ???? (このSQLだとまだユーザー情報と紐づいてない)