Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以做类似的事情select 1 as foo, foo+1 from dual
select 1 as foo, foo+1 from dual
这返回ERROR at line 1: ORA-00904: "FOO": invalid identifier
ERROR at line 1: ORA-00904: "FOO": invalid identifier
我有一个组成列的冗长计算,我希望能够轻松地使用该值在差异列中进行计算
您不能直接使用别名。一种方法是使用派生表:
SELECT foo, foo+1 FROM (SELECT 1 AS foo FROM dual) AS T