开发者

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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜