با مجموعهها، منظم بمانید
ذخیره و دستهبندی محتوا براساس اولویتهای شما.
نتایج را سفارش دهید
می توانید ترتیب ردیف ها را در پاسخ خود با استفاده از عبارت ORDER BY که از یک یا چند دنباله جدا شده با کاما تشکیل شده است، مشخص کنید:
FieldName ('ASC' | 'DESC')?
اگر ASC یا DESC بعد از نام فیلد مشخص نکنید، گزارش API پیشفرض ASC است.
بند ORDER BY زیر یک گزارش عملکرد را بر اساس تعداد نمایشهای نزولی و شناسههای پیشنهادی محصول صعودی مرتب میکند:
ORDER BY metrics.impressions DESC, segments.offer_id ASC
ORDER BY در معیارهای انتخاب نشده یا بخشهای انتخاب نشده مجاز نیست.
تعداد نتایج را محدود کنید
شما می توانید تعداد کل نتایج بازگشتی را با استفاده از بند LIMIT محدود کنید. با ترکیب این مورد با سفارش نتایج، میتوانید گزارشهای «N برتر» تولید کنید، مانند گزارشی که حاوی پنج محصول با بالاترین برداشت در 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;
فیلتر کردن (بند WHERE ) روی معیارها بدون انتخاب آنها مجاز نیست.
تاریخ آخرین بهروزرسانی 2024-11-13 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-11-13 بهوقت ساعت هماهنگ جهانی."],[[["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."]]],["The Merchant API beta, a new version of the Content API for Shopping, is introduced. You can order response rows using the `ORDER BY` clause with `ASC` or `DESC` order for selected fields. The `LIMIT` clause restricts the total results, enabling \"top N\" reports. `ORDER BY` is limited to selected fields, and filtering (`WHERE`) is not available for metrics that aren't selected. The maximum number of rows returned is 1000, requiring pagination for more results.\n"]]