Anyhow, in this example, let’s pretend we are going to build a summarized table with order totals for our customers.
But, we only want to use the customers that actually have had a purchase.
This can be particularly useful when doing very large bulk UPDATEs where you don’t want to have a ton of round-trips to the server for each statement, and you can use “rewrite Batched Statements=true” options for the My SQL Java connector if you want to create a huge update (ie, 10K rows in a single statement).
But you do have to make sure your records are actually in the table, as otherwise, you’ll end up creating new records.
I work a lot with Data Warehouse data, where we many times have duplicate data for speed purposes, etc.
I have also bought your book on how to start up a blog. I am also involved in the Johannesburg SQL Usergroup and I am preparing to give a talk on SQL Query plans at our next meeting on 14 October.I have a workaround at the moment which is to write the sum to a worktable and then update original table.I just thought there might be a shorter way instead of using a worktable.A couple of examples of when I do this is that I built a dynamic contest framework for my company, and also a Commission Calculator for recalculation of commission.These tables were both filled a few columns at the time to achieve the goal.