views:

13

answers:

1

Hi, I'm new to SQL Server, and used mysql for a while now...

SELECT A.acol, IF(A.acol<0,"Neg","Pos") as Column2 From Table

I want to do something like that on SQL Server, but there doesn't exist the IF instruction.

How do I replace that if, in a SQL Server 2008 Query?

+2  A: 
SELECT A.acol, 
    case when A.acol < 0 then 'Neg' else 'Pos' end as Column2 
From Table 
RedFilter