甲骨文查询抛出异常列定义不明确

时间:2018-10-13 03:08:48

标签: oracle

我是oracle世界的新手,但是我有下面的oracle查询,如下所示,该查询抛出异常,问题是在最外层的查询中,我不希望写列名,因为表中的78列计数,现在请建议如何克服以下oracle查询的异常情况,或者让我知道替代方法

SELECT * FROM ( WITH 
  BASE AS ( 
  SELECT TEMP.*, COUNT(*) OVER () AS TOTAL_RECORDS 
  FROM ( 
  SELECT AFT.*,
      PA.*,
      P.*
    FROM AFT_DATA AFT,
      CONTACT_TOKEN CT, 
      PRODUCT_ATTRIBUTE PA,
      PERSON P
    WHERE AFT.person_id          = 1
    AND AFT.TO_CONTACT_TOKEN_ID  = CT.CONTACT_TOKEN_ID
    AND AFT.PRODUCT_ATTRIBUTE_ID = PA.PRODUCT_ATTRIBUTE_ID
    AND AFT.PERSON_ID            = P.PERSON_ID
    AND AFT.CREATED_ON          >= CAST ('04/04/2018' AS DATE)
    AND AFT.CREATED_ON          <= CAST ('05/05/2018' AS DATE)) TEMP ) SELECT 
    ROUND((ROWNUM - MOD(ROWNUM-1, 1 )) / 1) +1 PAGE_NUMBER,  B.*  FROM base B) WHERE PAGE_NUMBER = 1 ;

上述查询的异常堆栈跟踪为

ORA-00918: column ambiguously defined
00918. 00000 -  "column ambiguously defined"

0 个答案:

没有答案