Reputation: 563
i have the sql query on the google bigquery
SELECT distinct
h.transaction.transactionId,
Date,
totals.pageviews,
h.item.itemQuantity,
h.transaction.transactionRevenue,
totals.bounces,
fullvisitorid,
totals.timeOnSite,
device.browser,
device.deviceCategory,
trafficSource.source,
channelGrouping,
h.page.pagePath,
h.eventInfo.eventCategory,
device.operatingSystem
FROM `atomic-life-148403.148778266.ga_sessions_*`,
UNNEST(hits) AS h
WHERE
_TABLE_SUFFIX BETWEEN REPLACE(CAST(DATE_ADD(CURRENT_DATE(), INTERVAL -1 YEAR) AS STRING), '-','')
AND CONCAT('intraday_', REPLACE(CAST(DATE_ADD(CURRENT_DATE(), INTERVAL 0 DAY) AS STRING), '-',''))
order by date
The Error IS:
Error: Encountered " "YEAR "" at line 32, column 75. Was expecting: ")" ...
However, I do not see what is wrong with "year". Can anyone help with it?
Upvotes: 0
Views: 164
Reputation: 3939
you are using BigQuery Standard SQL, but running under Legacy SQL.
Go to
Upvotes: 1