On Fri, Jul 18, 2008 at 2:00 PM, Jason Yergeau <[EMAIL PROTECTED]> wrote: > I'm having trouble working through a data problem. Any tips or > keywords that might clue me into a known pattern would be incredibly > appreciated! > > I have about 500,000 users in my system. Each user has a points > balance, updated by a system over which I have no control. I'd like > to track changes to each user's point balance over time by taking > timestamped snapshots of their balance, and saving it into a new > table. > > It's easy to take the snapshot: > > insert into balances (userid, points) select userid, points from users; > > This quickly takes the points field from my users table, and saves it > into a balances table, which saves the data along with a timestamp. I > can run that query on a regular basis without overly taxing my system. > > The first time its run, I get 500,000 rows of data. That's fine. But > the next time I run a query, I only want to save the differences in > balance. > > Anyone have any tips? > > Best, > Jason
What version of mysql do you need this to work with? -- Rob Wultsch -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]