I’m fairly new at writing SQL commands so I don’t exactly know where I’m going wrong here. I closed all the parentheses, but I still get the following error message:
Syntax error: Expected “)” but got keyword AND at [18:5]
Code:
goals as ( select sum(cast(goal as int64)) as goal from seed.seed_ads_goals goal_total and extract(month from [daterange_start]) = month )
Any hints?
Advertisement
Answer
WHERE
Clause is missing :
select sum(cast(goal as int64)) as goal from seed.seed_ads_goals as goal_total where extract(month from [daterange_start]) = month