数据透视查询唯一列错误

Pivot query unique column error

我在使用以下查询时在 oracle apex 中遇到错误。相同的查询在 sql 资源管理器中有效:

WITH pivot_data AS (
             select PSROW as PSROW,
    PSCOLUMN as PSCOLUMN
FROM LOG_PS_STATUS
WHERE PSGROUP='PLANT'
            )
    SELECT *
    FROM   pivot_data
    PIVOT (
           MAX(NULL)        --<-- pivot_clause
          FOR PSCOLUMN--<-- pivot_for_clause        
        IN  (&PS_COLUMN.)   --<-- pivot_in_clause         

)

The report query needs a unique key to identify each row. The supplied key cannot be used for this query. Please edit the report attributes to define a unique key column. ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.

您想创建交互式报告吗?如果是并且不需要详细视图 - 创建 IR 时必须 "Link to Single Row View" 设置为否。