需要帮助abs功能?

时间:2017-06-13 17:32:57

标签: sql mariadb

如果我写

abs((sum(daily_well_details.RegValue)
/ (sum(daily_well_details.Value*daily_well_details.Quantity)
+ sum(daily_well_details.RegValue))*100)) as accuracy

没有错误 - 结果确定

作为最终结果,我需要(100 - 准确度)

我尝试了几种语法,但总是收到错误信息" ...#HI000无效使用群组功能...."

SELECT....
ABS(sum(100-(sum(daily_well_details.RegValue)
/ (sum(daily_well_details.Value*daily_well_details.Quantity)
+ sum(daily_well_details.RegValue))*100))) as accuracy

1 个答案:

答案 0 :(得分:0)

您可以改为使用

SELECT.... ABS(100-(sum(daily_well_details.RegValue))/(sum(daily_well_details.Value*daily_well_details.Quantity))+(sum(daily_well_details.RegValue))*100))) as accuracy