Help, please. I created the next query but gen issue and I don`t understand how to fix it enter image description here
SELECT
tb1.*
FROM
(SELECT
tb1.date,
clie
Below is for BigQuery Standard SQL
#standardSQL
SELECT * EXCEPT(flag)
FROM (
SELECT
tb1.date,
clientId,
REGEXP_EXTRACT (hits.pagePath,"^([^\?]+)\?") AS page_url,
hits.type AS type,
hits.eventInfo.eventCategory AS eventCategory,
hits.eventInfo.eventAction AS eventAction,
hits.eventInfo.eventLabel AS person_email,
COUNTIF(type = "pageview") OVER(ORDER BY `date`) AS flag
FROM `table` AS tb1,
UNNEST (hits) AS hits
)
WHERE type = "pageview" OR (
eventCategory = "Enroll_Free_lecture"
AND flag > 0
)