WITH wait_table
        AS (SELECT   SUM (total_waits) total_waits,
                     SUM (time_waited_micro) total_time,
                     MAX(CASE event
                             WHEN 'db file sequential read'
                             THEN time_waited_micro / total_waits
                         END) avg_db_file_micro,
                     MAX(CASE event
                             WHEN 'db flash cache single block physical read'
                             THEN time_waited_micro / total_waits
                         END) avg_db_flash_micro,
                     SUM(CASE event
                             WHEN 'db flash cache single block physical read'
                             THEN total_waits
                         END) flash_waits
              FROM   v$system_event
             WHERE   event IN ('db file sequential read',
                               'db flash cache single block physical read'))
SELECT   total_waits,flash_waits,
         ROUND (avg_db_file_micro) avg_disk_time,
         ROUND (avg_db_flash_micro) avg_flash_time,
         total_time,
         ROUND(flash_waits * 
                (avg_db_file_micro - avg_db_flash_micro)) time_saved,
         ROUND(flash_waits *
               (avg_db_file_micro - avg_db_flash_micro) * 100
              / (total_waits* avg_db_file_micro),2) pct_io_time_saved
  FROM   wait_table
