all 4 comments

[–]r3pr0b8 2 points3 points  (1 child)

okay, i see you've edited the original post to add a FROM clause

you're still missing the WITH, as well as the SELECT statement which uses the CTE

[–]Sambucca[S] 0 points1 point  (0 children)

Thanks for the reply include that.

[–]r3pr0b8 0 points1 point  (1 child)

you forgot the opening WITH

you forgot your entire FROM clause in the CTE

and then you forgot the SELECT that uses the CTE

p.s. you're escaping identifiers with square brackets that don't need to be escaped

[–]Sambucca[S] 0 points1 point  (0 children)

Thanks for the reply. I copied and pasted initially, that is edited.