我在postgres中使用计算列时遇到问题.下面给出了一个在SQL中工作的类似代码,是否可以重新创建它PostgreSQL?
select cost_1, quantity_1, cost_2, quantity_2,
(cost_1 * quantity_1) as total_1,
(cost_2 * quantity_2) as total_2,
(calculated total_1 + calculated total_2) as total_3
from data;
Run Code Online (Sandbox Code Playgroud)
在PostgreSQL类似的代码中返回错误:
列total_1和total_2不存在.