我已经被这个错误困扰了2个小时。
我嵌套了select语句来获取第一个值。
select tbl.table_name,
(select distinct(FirstItem)
from
(select first_value(column_name) over (order by timestamp asc rows unbounded predecing) as FirstItem
from log_table_b l
where tbl.assignment_no = l.rpt_no)
) as "USERNAME",
from prod_table tbl;
它返回以下错误:
ERROR at line 6:
ORA-00904: "TBL"."ASSIGNMENT_NO": invalid identifier
我尝试了很多方法,但似乎没有什么能帮助我。
ORA-01427: single-row subquery returns more than one row
错误的原因,所以我写了这个select distinct(FirstItem)...
查询。 - user206168