No, it works but it take a little bit of care (with any version).
Typically the database will apply transformations to a query to simplify it before execution. As such your inline view (and hence the result cache) may evaporate before the query is even run, eg when I did an optimizer trace on:
select /* connor456 */ count(*) from
( select /*+ result_cache */ owner, count(*) cnt
from t
group by owner
order by owner
)
I see this in the trace file
Final query after transformations:******* UNPARSED QUERY IS *******
SELECT "T"."OWNER" "OWNER",COUNT(*) "CNT" FROM "MCDONAC"."T" "T" GROUP BY "T"."OWNER" ORDER BY "T"."OWNER"
We got rid of all the "redundant" inlining etc to make things "better"...
So if we know better, and we to keep that inline view as a standalone thing, we can tell the optimizer this,
SQL> set autotrace on stat
SQL> select /*+ no_merge(@rc) connor123 */ count(*) from
2 ( select /*+ qb_name(rc) result_cache */ owner, count(*) cnt
3 from t
4 group by owner
5 order by owner
6 )
7 /
COUNT(*)
----------
31
Statistics
----------------------------------------------------------
64 recursive calls
0 db block gets
29 consistent gets
0 physical reads
0 redo size
526 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
1 rows processed
SQL>
SQL> /
COUNT(*)
----------
31
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
526 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
and our result caching is back again