常見問題
本頁面收集了一些實用提示,可在您建立第一個查詢時派上用場。
問題:指標未顯示在結果中
貨幣相關指標 (例如 metrics.cost_micros) 需要在 SELECT 子句和 WHERE 子句中加入 segments.date
。
問題:CONTAINS 運算子不適用於字串欄位
如要檢查字串欄位是否包含子字串,請勿使用 CONTAINS
(或 CONTAINS NOT
) 運算子。
CONTAINS
可搭配儲存值清單的欄位使用,用於檢查清單是否包含一或多個特定值。
如要檢查子字串是否存在,您可以使用 REGEXP_MATCH
,例如
SELECT
customer.descriptive_name,
... // other fields
FROM
campaign
WHERE customer.descriptive_name REGEXEP_MATCH 'Customer.*'
瞭解詳情
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-24 (世界標準時間)。
[null,null,["上次更新時間:2024-11-24 (世界標準時間)。"],[[["Currency metrics like `metrics.cost_micros` require including `segments.date` in both the SELECT and WHERE clauses to appear in results."],["Avoid using the `CONTAINS` operator for substring checks in string fields; utilize `REGEX_MATCH` instead for this purpose."],["The `CONTAINS` operator is designed for verifying if a list-type field contains specific values."]]],["Currency metrics like `metrics.cost_micros` require `segments.date` in both the SELECT and WHERE clauses. The `CONTAINS` operator is not for substring searches within string fields; it's for checking value lists. Use `REGEXP_MATCH` to find substrings in string fields, as demonstrated with the example of searching `customer.descriptive_name` for patterns like 'Customer.*'.\n"]]