Reputation: 1
WITH nl_sentcount
AS(
Select nl_id, count(user_id) as sent_num
from sheet1$
Where event_type='nlsent'
group by nl_id
)
Why the error shows as
Msg 102, Level 15, State 1, Line 7 Incorrect syntax near ')'.
Upvotes: 0
Views: 41
Reputation: 1269563
You need a select
statement after the WITH
to do something:
WITH nl_sentcount AS (
Select nl_id, count(user_id) as sent_num
from sheet1$
Where event_type='nlsent'
group by nl_id
)
select *
from nl_sentcount;
Upvotes: 2