yingying qian
yingying qian

Reputation: 1

how do I fix this coding issue?

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

Answers (1)

Gordon Linoff
Gordon Linoff

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

Related Questions