1
在select和where塊中使用相同的表達式時,postgresql中有沒有辦法重複自己?別名在postgresql查詢中長時間重複的表達式
select (
|/((power((consumption_2011 - consumption_3y/3), 2)
+ power((consumption_2012 - consumption_3y/3), 2)
+ power((consumption_2013 - consumption_3y/3), 2)
)/3)) as deviation
from consumption
where (
|/((power((consumption_2011 - consumption_3y/3), 2)
+ power((consumption_2012 - consumption_3y/3), 2)
+ power((consumption_2013 - consumption_3y/3), 2)
)/3) > 0.8
)