List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:September 17 2010 11:16am
Subject:Re: Update record count
View as plain text  
On Fri, Sep 17, 2010 at 3:51 AM, Shawn Green (MySQL) <
shawn.l.green@stripped> wrote:

>
> So if 10 rows of A match your conditions, 1 row from B match your
> conditions, and 10 rows from C match your conditions, then this query
> produces 10*1*10 total row combinations.
>

Umm. It's friday, so I may be rather off it, too, but aren't the conditions
inclusive ? They're AND, not OR. A Cartesian join on a(10 rows), b(1 row)
and c(10 rows) would produce as you say.

I would say that the number of rows is the number where
 * c.f3 is x, y or z
 * AND where b.f4 = yen
 * FROM the set produced by the join condition.


Check the number of rows in c that match f3 in (x, y, z).
Match those with rows in b as per join. This will yield the same or less
rows.
Filter those that match b.f4 = yen. This again will yield same or less.
Match those with a as per join. This, too, will yield same or less, and will
be your final number of rows.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

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