I am learning CTE, and tried out the following query
WITH fooCTE
AS
(
SELECT TOP 5 f.bar FROM foobar f
)
But it's displaying an error which is quite incomprehensible.
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near ')'.
Infact when I run the query below, I get the top five values being displayed.
SELECT TOP 5 f.bar FROM foobar f
96.8
92.4
99.3
68.9
74.8
SELECT f.bar from foobar f;
96.8
92.4
99.3
68.9
74.8
69.3
94.6
74.8
36.4
92.6
69.4
99.2
39.9
96.2
99.1
I hope am not wrong with the syntax and stuff. Where am I wrong?