SQL Server query replace for MySQL Instruction
I'm new to SQL Server, and use开发者_如何学运维d 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?
SELECT A.acol,
case when A.acol < 0 then 'Neg' else 'Pos' end as Column2
From Table
精彩评论