With Clause, Incorrect syntax near ')'. (SQL Server 2016) -


i using clause , have run odd issue. simple queries getting incorrect syntax error returned , can't figure out why be.

whenever run code simple as:

with table1 (select value1, value2 table1) 

i 'incorrect syntax near ')' ' error.

i using before without trouble, feel i'm making obvious dumb mistake i'm not catching. point out i'm doing wrong?

it cte - need select @ end of it.

i.e.

with cte (     select          value1,          value2      table1 )  select * cte 

additionally, having cte named same table you're pulling from, not idea. had them both table1.


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -