ORA-01446:无法从DISTINCT,GROUP BY等视图中选择ROWID或采样

时间:2012-05-25 02:39:30

标签: sql oracle oracle10g ora-01446

只是尝试在Customer表中插入一个未包含在错误表中的Row。

- 查看

Create View A3_SRC_CUST_VIEW As
Select SRC_CUST_A.*, rowid as row_id From SRC_CUST_A
Union All
Select SRC_CUST_B.*, rowid as row_id From SRC_CUST_B;

- 插入声明

Insert Customer (DW_CUST_ID, CUSTID, CUSTNAME, CUSTEMAIL, CUSTLOC)
Select  Dw_Cust_Id.Nextval,  v.CID,  v.NAME, v.Email, v.LOC
From CustView v
Where v.rowid Not In
    (Select Source_RowId From A3_Error_Event  Where Filter_Id = 4 );

我得到的错误是 ORA-01446:无法从DISTINCT,GROUP BY等视图中选择ROWID或采样。 01446. 00000 - “无法从DISTINCT,GROUP BY等视图中选择ROWID或采样”

1 个答案:

答案 0 :(得分:1)

您正在从视图中选择rowid而不是row_id。这会导致错误。