Hey there. I have very simple SQL code in SQL server 2014 management studio. Here it is:
DECLARE @a INT, @b INT
SET @a=COUNT(Capital) FROM [dbo].[list_of_countries]
SET @b=@a-1
SELECT @b as Capitals
-------------------------
And when executing, the error appears:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'FROM'.
---------------------
Can you tell me what is the problem here?