常见问题解答
本页汇总了一些在创建第一个查询时可能很有用的提示。
问题:指标未显示在结果中
与币种相关的指标(例如 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.*'
了解详情
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-24。
[null,null,["最后更新时间 (UTC):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"]]