-
캐글 advanced_sql/04-writing-efficient-queries<Kaggle-Course> 2023. 3. 15. 19:49728x90
WITH LocationsAndOwners AS ( SELECT * FROM CostumeOwners co INNER JOIN CostumeLocations cl ON co.CostumeID = cl.CostumeID ), LastSeen AS ( SELECT CostumeID, MAX(Timestamp) FROM LocationsAndOwners GROUP BY CostumeID ) SELECT lo.CostumeID, Location FROM LocationsAndOwners lo INNER JOIN LastSeen ls ON lo.Timestamp = ls.Timestamp AND lo.CostumeID = ls.CostumeID WHERE OwnerID = MitzieOwnerID
728x90'<Kaggle-Course>' 카테고리의 다른 글
캐글 data_cleaning/02-scaling-and-normalization (0) 2023.03.16 캐글 data_cleaning/01-handling-missing-values (0) 2023.03.16 캐글 advanced_sql/02-analytic-functions (0) 2023.03.15 캐글 advanced_sql/03-nested-and-repeated-data (0) 2023.03.15 캐글 advanced_sql/01-joins-and-unions (0) 2023.03.15