List:General Discussion« Previous MessageNext Message »
From:Kyle Lange Date:May 5 2003 11:10pm
Subject:RE: Comparing two snapshots of a table to produce a change report
View as plain text  
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

Thread
Comparing two snapshots of a table to produce a change reportMike Hillyer5 May
  • Re: Comparing two snapshots of a table to produce a change reportZak Greant6 May
  • Re: Comparing two snapshots of a table to produce a change reportJeremy Zawodny6 May
RE: Comparing two snapshots of a table to produce a change reportDave Christensen6 May
  • Am using mysql and oscommerce, but i can't find my database that i created.David Jackson6 May
  • RE: Comparing two snapshots of a table to produce a change reportKyle Lange6 May
  • localhost questionYa-Chun Lin6 May
RE: Comparing two snapshots of a table to produce a change reportMike Hillyer6 May
Re: localhost questionJames Moe6 May
  • Re: localhost questionYa-Chun Lin6 May
    • Re[2]: localhost questionStefan Hinz6 May
  • Re: Re[2]: localhost questionYa-Chun Lin6 May
    • Re[4]: localhost questionStefan Hinz7 May
  • Re: Re[4]: localhost questionYa-Chun Lin7 May
  • import binary file?Ya-Chun Lin29 May