Skip to content
Advertisement

Wrongly closed SQL parentheses [closed]

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
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement