TESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(FAILOVER = ON)
(LOAD_BALANCE = ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = XXXX))
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = YYYY))
)
(CONNECT_DATA = (SERVICE_NAME = TESTDB))
)
FOR dates IN (SELECT DISTINCT trunc(PLANSOSDATEST) AS dates FROM PA_ANDON_CALLS) -- тут ругается не понятно на что.. Тут нельзя указывать подзапрос в вашем случае
subquery A subquery is used only in conjunction with the XML keyword. When you specify a subquery, all values found by the subquery are used for pivoting. The output is not the same cross-tabular format returned by non-XML pivot queries. Instead of multiple columns specified in the pivot_in_clause, the subquery produces a single XML string column.
В модели users мы никак не обращаемся к usersAwards