我在使用计算列的时候遇到了问题,在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;
在 PostgreSQL
中,类似的代码会返回以下错误:
列 total_1 和 total_2 不存在。