강의

멘토링

커뮤니티

Inflearn Community Q&A

sallyhj1237613's profile image
sallyhj1237613

asked

[A hundred words are not as good as seeing once] Advanced SQL for data analysis

[Advanced] Subquery HackerRank Challenges Problem Solving + With statement

똑같이 작성했는데 오류가 발생합니다 ㅠ

Written on

·

308

0

with counter as (

select hackers.hacker_id

, hackers.name

, count(*) as challenges_created

from Challenges

inner join Hackers on Challenges.hacker_id = Hackers.hacker_id

group by hackers.hacker_id, hackers.name)

계속 아래와 같은 오류가 발생합니다 ㅠㅠㅠ

  •  

    Msg 102, Level 15, State 1, Server dbrank-tsql, Line 8
  • Incorrect syntax near ')'

 

란 오류가 자꾸 발생합니다 ㅠㅠ

 

오류sqlwithas

Answer 1

0

참고 : Stack Overflow - https://stackoverflow.com/questions/45376755/with-clause-incorrect-syntax-near-sql-server-2016

간단히 말해 불완전한 구문이라 에러가 발생한다고 설명하고 있습니다.
with ~ as ~ 문은
마지막에 SELECT 해줘야 된다고 합니다.
작성자님이 작성하신
with counter as (~~~) select * from counter 해줘야 하는것 같습니다.
잘 동작했으면 좋겠네요!

sallyhj1237613's profile image
sallyhj1237613

asked

Ask a question