Reputation: 6557
I cannot figure out why this is wrong. The syntax for an IFF is defined here:
https://msdn.microsoft.com/en-us/library/hh213574.aspx
Why does it complain about the IN operator?
Upvotes: 2
Views: 48
Reputation: 2755
It looks like you're using a version of SQL Server that does not support this function (pre SQL Server 2012). An alternative is to use a case statement like so:
Select NEWID(), m.MALEPUNKTYPE,
case when m.MALEPUNKTYPE in ('E17', 'E18') then 'D02' else null end
from AMALD m
This is supported from SQL Server 2005 onwards however it should work on earlier versions too
Upvotes: 1