I am new to SQL Server and doing a tutorial, but cant seem to find the error. It's exactly as the tutorial suggests, but won't execute. See error below. Does certain functionality need to be turned on? I am using SQL Server 2008R2 Express. Does that matter?
use AdventureWorks
go
SELECT top 5 Name, GroupName
CASE GroupName
when 'Research and Development' then 'RD'
when 'Sales and Marketing' then 'SM'
else 'Other'
END
FROM HumanResources.department;
go
The error is...
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'case'.