Skip to content

SQL result comparison

OraclePostgreSQLMySQL

Check whether a rewritten or tuned query returns the same captured data. Compare rows without depending on their order, or select keys to identify changed cells. This comparison covers fetched results, not unfetched pages or whole tables.

Compare fetched results before and after a SQL change, including duplicate counts and key-based changes.
Fictional demo data in the English interface. Existing Oracle/PostgreSQL captures illustrate the shared UI; see the MySQL section for its controls and limits. Available operations also depend on permissions.

Open this tool from Data validation in the top menu. Review the settings below before running it.

Control or setting How to use it What happens
Before / After: Use captured result Capture each result using the SQL result toolbar, then assign the desired side. Keeps independent snapshots while you close the dialog and execute another query.
Open / Save result JSON Save each side or open a previously saved snapshot. Import limits: 8 MiB, 10,000 rows and 512 columns. Files include original values.
Key columns Leave empty or select one or more non-NULL unique columns. No keys: counts identical rows including duplicates. Keys: identifies added, removed and changed rows; duplicate or NULL keys are refused.
Numeric text equivalence Enable to compare ordinary decimal text and numbers as equivalent. Off by default. Decimal text is normalized without conversion to imprecise floating-point numbers. Scientific notation remains strict.
Compare Run after registering both snapshots and choosing comparison settings. Displays counts for unchanged, added, removed and changed rows. Row order is ignored.
Differences / Export report Review changed column names and before/after values. The UI shows up to 100 differences; the JSON report contains all computed differences.

Capture a baseline before rewriting joins, filters or aggregations, then compare the optimized result. Check the same data range and consider concurrent updates; matching samples do not prove every input is correct. See the SQL guide for execution plans and tuning.

NULL differs from empty text. Numbers differ from text by default. Row duplicates count even when their values match. Stored captures are kept only in memory and cleared on disconnect, reconnect or exit; save a JSON file if you need them later.

  1. Execute the original SQL, click Compare SQL results in its result toolbar and register it as Before.
  2. Close the dialog, execute the revised query, capture its result and register it as After. You can also open saved result JSON files.
  3. Choose keys and numeric equivalence if needed, compare, inspect differences and export a report.

All screen guides · Read the manual