フリー問題

SnowPro Advanced: Data Analyst のフリー問題 6 / 20 問目

問題文

A staging table contains multiple versions of each customer record, one per extract, with an extracted_at timestamp. The analyst needs exactly one row per customer, keeping the newest version. Which query shape is the most direct?

選択肢

  1. Group by customer with a MAX on the timestamp, which returns the newest version of every column for each customer because the grouping keeps that row intact.
  2. Number the rows within each customer by descending timestamp with a window function, then keep the rows numbered one using QUALIFY.
  3. Order the result by timestamp descending for the customer column and add a LIMIT equal to the number of distinct customers.
  4. Select distinct on the customer column, which keeps the row from the staging table and the extracts with the highest timestamp for each value.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。