Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Hasil pesanan
Anda dapat menentukan urutan baris dalam respons menggunakan klausa ORDER BY,
yang terdiri dari satu atau beberapa urutan yang dipisahkan koma dari:
FieldName ('ASC' | 'DESC')?
Jika Anda tidak menentukan ASC atau DESC setelah nama kolom, Reporting API
nilai defaultnya adalah ASC.
Klausa ORDER BY berikut mengurutkan laporan performa dengan cara menurun
tayangan dan ID penawaran produk menaik:
ORDER BY metrics.impressions DESC, segments.offer_id ASC
ORDER BY tidak diizinkan pada metrik yang tidak dipilih atau segmen yang tidak dipilih.
Membatasi jumlah hasil
Anda dapat membatasi jumlah total hasil yang ditampilkan menggunakan klausa LIMIT.
Menggabungkan ini dengan pengurutan hasil, Anda dapat menghasilkan "top N" berbagai laporan, seperti
yang berisi lima produk dengan tayangan tertinggi selama
30 hari:
Contoh
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;
Pemfilteran (klausa WHERE) tidak diizinkan pada metrik tanpa memilihnya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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"]]