Diff two result sets

✓ functional

Put two result sets side by side and see what changed without doing row-by-row detective work.

When the question is “what changed?”, put two result sets together and let SQLly answer it plainly. Rows are marked added, removed, or changed - and a schema mismatch is called out rather than quietly producing a misleading comparison.

Turning it on

Toggle Track difference in the results toolbar and keep working. Each completed run of that tab is retained, and once there is something to compare against, a Diff tab appears next to Grid. Run your query, make the change, run it again - the comparison is waiting for you.

How rows are matched

By default it is a set comparison, not a sequence comparison: rows are matched on exact cell-value equality and row order is irrelevant, so a query without an ORDER BY does not report the whole result as churned. Duplicates use multiset semantics - two identical rows before and one after means one removed and one unchanged.

Nominate key columns and the comparison gets sharper: rows are matched on the key, so a row whose status went from pending to shipped is reported as one changed row, with the before and after value per column - rather than being disguised as a delete plus an insert.

ModeReports
No keyAdded, removed, and unchanged rows, by whole-row value.
With keysAdded, removed, changed (with per-column before/after), and unchanged.

Either way you get a one-line summary - +3 added, -1 removed, ~2 changed, 10 unchanged - so “nothing changed” is a statement you can act on rather than an impression.

Schema mismatches are reported, not papered over

Different columns means no comparison. If the two sets differ in column count, names, or types, SQLly says “Schema mismatch - cannot compare” and describes the difference. Lining up mismatched columns by position would produce a diff that looks authoritative and is wrong.

The bounds

  • Up to 8 runs are retained per query tab while tracking is on, so you can compare against an earlier run and not only the previous one.
  • Result sets over 100,000 rows are skipped. Diffing keeps a full copy of the previous set and builds lookup tables over both sides, which would roughly triple the memory a large set already occupies. Same reason spill-backed and still-streaming sets are skipped: an honest “not compared” beats an unpredictable machine.