Skip to Main Content
  • Questions
  • how to compare output for 2 results in oracle

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Pinky.

Asked: January 21, 2020 - 8:56 pm UTC

Last updated: January 22, 2020 - 4:04 am UTC

Version: 12.1.0.2

Viewed 1000+ times

You Asked

How to compare the results from 2 sql queries.

This is the query i need to execute on each session for specific sqlid. should i save the results somewhere in temp and than do comparison or any other way please update.
select s.name, m.value/1024/1024 mb from v$mystat m, v$sysstat s where m.statistic#=s.statistic# and (s.name like '%physical IO%' or s.name like '%optimized%' or s.name like 'physical%total bytes');

and Connor said...

Go to our Resources => Download section and search for "runstats"

It contains the info on capturing before/after and the comparison queries

Or for a totally generic facility, check out Stew's post

https://stewashton.wordpress.com/2014/02/04/compare-and-sync-tables-tom-kyte-and-group-by/



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library