阅读背景:

如果value = 0,则使用另一列的值

来源:互联网 

I have 2 columns with values, column A and column B. Column A never has 0 values, but Column B does, but not that many. I would rather use the values in column B, as they are more accurate, but if the value is 0, then I would like to use the value in the same row, but in column A. I would prefer then to have an additional column called C, that would store mostly values of column B, but if it is 0 in a particular row, it would have the value of column A. In excel this is easy, I just go: IF(B2=0,A2,B2). But I am not sure how to achieve this in SQL. Below is my code:I have 2 columns with values, column A and colu




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: