l******9 发帖数: 579 | 1 【 以下文字转载自 Quant 讨论区 】
发信人: light009 (light009), 信区: Quant
标 题: SQL multiply all values of a column in table
发信站: BBS 未名空间站 (Wed Jun 25 17:35:13 2014, 美东)
I need to multiply all float values of a column in table if the column value
is positive. If I find a value is null or negative or not numeric, I raise
an error in SQL server 2008 R2.
given table t0:
col
1.5
2
given table t1:
col
2
-1
5
0
null
NaN
For t0 I should get 3, for t1, I should raise an error.
Any help would be appreciated. | s**********o 发帖数: 14359 | 2 你不是乘数字么,你乘其它的干嘛,数据库不是STRUCTURED的,什么DATATYPE都不知道
怎么MANIPULATE? |
|