Staging.Sales という名前のテーブルを含む Fabric ウェアハウスがあります。 Staging.Sales には次の列が含まれます。

ProductID と ProductName arxl の集計金額が 10,000 を超えていることを表示する 2023 年のデータを返す T-SQL クエリを作成する必要があります。どのクエリを使用する必要がありますか?
正解:B
The correct query to use in order to return data for the year 2023 that displays ProductID, ProductName, and has a summarized Amount greater than 10,000 is Option B.
The reason is that it uses the GROUP BY clause to organize the data by ProductID and ProductName and then filters the result using the HAVING clause to only include groups where the sum of Amount is greater than 10,000. Additionally, the DATEPART(YEAR, SaleDate) = '2023' part of the HAVING clause ensures that only records from the year 2023 are included. Reference = For more information, please visit the official documentation on T-SQL queries and the GROUP BY clause at T-SQL GROUP BY.