Would this work, given my first example;SELECT
CASE WHEN snapshot1.rollno <> snapshot2.rollno THEN 'rollno' ELSE NULL END AS changed_rollno,
CASE WHEN snapshot1.name <> snapshot2.name THEN 'name' ELSE NULL END AS changed_name
FROM snapshot1 JOIN snapshot2 ON snapshot1.primary_key = snapshot2.primary_key;
not able to test now. Will do that later. Note the query can become cumbersome on tables with many fields. You have to repeat the CASE for every field in the table. I should return the changed fields.
Again: Snapshot ONLY WORKS with Journal-mode WAL
Checking for changed VALUE's for a Field is usually done via Auditing-mechanism, which has to be implemented by yourself.
A journal-mode WAL in SQLite is comparable to the binary log in MySQL, but even there a dba can decide: Nope, binary log, only goes back to the last successful Transaction.
That said:
There is only one "smart way" to get what TS wants: Implement an auditing mechanism yourself.
Easily done with Triggers.
Period!
It's not dependant on journal-mode or whatever else, and you're flexible to the nth degree (add/remove columns/tables, whatever, during the lifetime of the program/database)