0
我執行這個查詢中的SQLDeveloper針對Oracle 10g中一個數據庫:錯誤加入與分頁查詢適用於Oracle 10g
select P1.FIELD1, P1.COD from
(select P1.FIELD1, P1.COD, row_number()
over (order by P1.FIELD1) r from
SCHEMA1.P2
INNER JOIN SCHEMA1.P1 on SCHEMA1.P1.COD=P2.FIELD2)
where P1.FIELD_11 = 'VALUE1' and r between 6 and 10;
而且Oracle返回:
Error SQL: ORA-00904: "P1"."FIELD_11": invalid identifier
我想:
select SCHEMA1.P1.FIELD1, SCHEMA1.P1.COD from
(select SCHEMA1.P1.FIELD1, SCHEMA1.P1.COD, row_number()
over (order by SCHEMA1.P1.FIELD1) r from
SCHEMA1.P2
INNER JOIN SCHEMA1.P1 on SCHEMA1.P1.COD=SCHEMA1.P2.FIELD2)
where SCHEMA1.P1.FIELD_11 = 'VALUE1' and r between 6 and 10;
而且我得到了同樣的錯誤:
ORA-00904: "SCHEMA1"."P1"."FIELD_11": invalid identifier
我找不到Oracle內部連接和分頁的select子句的例子,所以我不知道我在做什麼錯誤。