with t as (select /*+ materialize */) * from tab)

select * from t;