ORDER BY 句を使用してレスポンスの行の順序を指定できます。
これは、次の 1 つ以上のカンマ区切りシーケンスで構成されます。
FieldName ('ASC' | 'DESC')?
フィールド名の後に ASC または DESC を指定しない場合、Reporting API は
デフォルトは ASC です。
次の ORDER BY 句は、パフォーマンス レポートを降順で並べ替えます。
昇順の商品 ID のデータ:
ORDER BY metrics.impressions DESC, segments.offer_id ASC
ORDER BY は、選択されていない指標または選択されていないセグメントには使用できません。
結果の数を制限する
LIMIT 句を使用して、返される結果の合計数を制限できます。
これを結果の順序付けと組み合わせると、「上位 N 個」を生成できます。レポートを作成できます。
過去最高のインプレッションを獲得した 5 つの商品を含むレポート
30 日:
例
SELECT
segments.offer_id,
metrics.impressions
FROM MerchantPerformanceView
WHERE segments.date BETWEEN '2020-12-01' AND '2020-12-31'
ORDER BY metrics.impressions DESC
LIMIT 5;
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-09-20 UTC。"],[[["The Merchant API is the new version of the Content API for Shopping and represents the future of product data integration."],["You can order results with the `ORDER BY` clause using fields and `ASC` or `DESC` for ascending or descending order respectively."],["The `LIMIT` clause enables you to specify the maximum number of returned results and can be combined with `ORDER BY` to generate \"top N\" reports."],["While a query's maximum result limit is 1000 rows, pagination with `pageToken` is necessary for retrieving additional results beyond this limit."],["Filtering using the `WHERE` clause on metrics necessitates their selection in the query."]]],[]]