If you only want those records where 'any' field has changed (nad don't
specifically want to know exactly which Field has changed), surely simply
putting a 'lastUpdated' field, on those tables you want to track, as the
first TIMESTAMP column in the table would then give you a WHERE to select on
based on any in 'lastUpdated' Timestamp with a value after the last month's
report was generated.
K
-----Original Message-----
From: Christensen, Dave [mailto:DChristensen@stripped]
Sent: Tuesday, May 06, 2003 12:51 AM
To: 'Mike Hillyer'; 'mysql@stripped'
Subject: RE: Comparing two snapshots of a table to produce a change report
I know that this is a different approach, but we've recently implemented a
system to track agents that we have under contract. We track any changes to
an agent's data in a diary table that contains information that includes
date/time changed, before and after values, etc. We routinely prepare
reports that reflect changes.
You could do something like that using a series of joins for each column,
too, where each join's select condition would be equivilence (or non-)
between the snap shot and the original table.
-----Original Message-----
From: Mike Hillyer [mailto:mhillyer@stripped]
Sent: Monday, May 05, 2003 4:38 PM
To: mysql@stripped
Subject: Comparing two snapshots of a table to produce a change report
Hi Everyone;
I am trying to work on a solution for an application I am working on.
Our app tracks data for customers who are sent a new data file every month
that is generated from a query outputted to a CSV file.
I need to implement a system whereby the file can be accompanied by a report
of changes to the file over the course of the month. We were thinking that
each time an export is done, the data table can be copied to another table
by creating a table using a SELECT SQL statement, that way we would have
historical snapshots of the table (space is not an issue).
My question is: can anyone think of a query to get the difference between a
snapshot and the current table? (Return all rows where any field is has
changed)?
Mike Hillyer
www.vbmysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=1
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=1