【问题标题】:Why do I keep getting an error message saying Syntax Error: Unexpected string literal 'data-to-insights.ecommerce.all_sessions_raw' at [2:6]为什么我在 [2:6] 处不断收到一条错误消息,提示语法错误:意外的字符串文字 'data-to-insights.ecommerce.all_sessions_raw'
【发布时间】:2021-10-08 19:24:39
【问题描述】:

我想在 Google Cloud Platform 上键入执行以下 BigQuery 语句:

SELECT COUNT(*) as num_duplicate_rows, * 
FROM `data-to-insights.ecommerce.all_sessions_raw` 
GROUP BY fullVisitorId, channelGrouping, time, country, city, totalTransactionRevenue, transactions, timeOnSite, pageviews, sessionQualityDim, date, visitId, type, productRefundAmount, productQuantity, productPrice, productRevenue, productSKU, v2ProductName, v2ProductCategory, productVariant, currencyCode, itemQuantity, itemRevenue, transactionRevenue, transactionId, pageTitle, searchKeyword, pagePathLevel1, eCommerceAction_type, eCommerceAction_step, eCommerceAction_option HAVING num_duplicate_rows > 1

我收到以下错误消息。

Syntax error: Unexpected string literal 
'data-to-insights.ecommerce.all_sessions_raw' at [2:6]

我目前正在尝试在 Google Cloud Platform 上使用 BigQuery,但它失败并出现上述错误。我该如何解决这个问题?

【问题讨论】:

  • 您的表格似乎已经用反引号括起来了。您确定您没有对控制台运行旧查询吗?

标签: sql google-cloud-platform google-bigquery


【解决方案1】:

您的查询正常:

SELECT COUNT(*) as num_duplicate_rows, * 
FROM `data-to-insights.ecommerce.all_sessions_raw` 
GROUP BY fullVisitorId, channelGrouping, time, country, city, totalTransactionRevenue, 
    transactions, timeOnSite, pageviews, sessionQualityDim, date, visitId, type, productRefundAmount, 
    productQuantity, productPrice, productRevenue, productSKU, v2ProductName, v2ProductCategory, productVariant, 
    currencyCode, itemQuantity, itemRevenue, transactionRevenue, transactionId, pageTitle, searchKeyword, 
    pagePathLevel1, eCommerceAction_type, eCommerceAction_step, eCommerceAction_option 
HAVING num_duplicate_rows > 1

处理 5.6 GB 后返回 615 行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-15
    • 1970-01-01
    • 2017-06-27
    • 2014-04-12
    • 1970-01-01
    • 1970-01-01
    • 2014-05-27
    • 1970-01-01
    相关资源
    最近更新 更多