鉴于我有一些数据表...我有一个查询,用于检索具有复杂案例子句的数据...
SELECT row_number() over (...) as num, ... as field 1,
case ... as field2
FROM ...
现在我想添加更复杂的逻辑,比如
SELECT row_number() over (...) as num, ... as field 1,
field2 * num as field2
FROM ...
基本上,如果我输入row_num + 1 as field2
Postgres 会返回我
错误:列“row_num”不存在
如何在此查询中引用查询字段?