List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:September 16 2010 9:12pm
Subject:Update record count
View as plain text  
I should be able to figure this out, but I'm puzzled. Here's a simplified 

UPDATE a JOIN b ON a.kb = b.kb JOIN c ON b.kc = c.kc
SET a.f1 = NOW(),
  b.f2 = NOW()
WHERE c.f3 IN ('x', 'y', 'z')
AND b.f4 = 'yen';

It seems to me that if there are 3 rows found in `c` that match a total of 10 
rows in `a` that each, in turn, matches 1 row in `b`, then the total number of 
qualifying would be 10 + 10 -> 20.

That should also be the number of rows changed.

Somehow the numbers reported by MySQL don't seem to match up in my real case, 
even though the results seem to be what I want. The numbers reported were way 
too high, and I don't understand it.

I can supply more information, if necessary, but have I gone off the rails 


Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site:

Update record countJerry Schwartz16 Sep
  • Re: Update record countMySQL)17 Sep
    • Re: Update record countJohan De Meersman17 Sep
    • RE: Update record countJerry Schwartz17 Sep