我有这样的多个SQL查询,它显示所有重复的行从表......
#standardSQL
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;
我的问题是,如何修改这个SQL查询,以显示结果的顺序由一些列,例如:。fullVisitorId
如果我把最后一行的and命令......不工作。
HAVING num_duplicate_rows > 1; ORDER BY fullVisitorId
我得到了这个错误
Syntax error: Unexpected keyword ORDER at [6:32]
好吧,所以这里的情况结束了。似乎我不能在不回答问题的情况下关闭这个帖子。