Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Kết quả đơn đặt hàng
Bạn có thể chỉ định thứ tự các hàng trong phản hồi bằng mệnh đề ORDER BY,
bao gồm một hoặc nhiều chuỗi được phân tách bằng dấu phẩy:
FieldName ('ASC' | 'DESC')?
Nếu bạn không chỉ định ASC hoặc DESC sau tên trường, thì API Báo cáo
mặc định là ASC.
Mệnh đề ORDER BY sau đây sắp xếp báo cáo hiệu suất theo thứ tự giảm dần
số lượt hiển thị và mã ưu đãi sản phẩm tăng dần:
ORDER BY metrics.impressions DESC, segments.offer_id ASC
Không được phép sử dụng ORDER BY trên những chỉ số chưa chọn hoặc phân khúc chưa được chọn.
Giới hạn số lượng kết quả
Bạn có thể giới hạn tổng số kết quả được trả về bằng mệnh đề LIMIT.
Kết hợp giá trị này với thứ tự kết quả, bạn có thể tạo ra "N hàng đầu" các báo cáo, chẳng hạn như
báo cáo chứa 5 sản phẩm có số lượt hiển thị cao nhất trong thời gian qua
30 ngày:
Ví dụ:
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;
Không được phép lọc (mệnh đề WHERE) trên các chỉ số nếu không chọn chúng.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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."]]],["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"]]