Sql error near syntax error. Incorrect syntax near year. incorrect syntax near the keyword 'as'. line 2: incorrect syntax near the keyword 'where'.. incorrect syntax near case sql.