Hi Adam, all,
Adam Wolff wrote:
You could you use UNION to make this all execute in a single query.
Sure you can use UNION to get the data or the (separate) counts from the
four tables, but a plain UNION can not sum over these individual parts.
I have not checked whether you can have a UNI
Hi Rhino, all,
Rhino wrote:
Hi Chris, Joerg, and everyone else following this discussion,
Joerg, you are correct; the best way to sum the tables is individually
and then add the sums together with program logic of some kind, [[...]]
I'm afraid I jumped in and gave correct but irrelevant inf
e -
From: "Joerg Bruehe" <[EMAIL PROTECTED]>
To: "Chris Sansom" <[EMAIL PROTECTED]>
Cc: "Rhino" <[EMAIL PROTECTED]>; "MySQL List"
Sent: Wednesday, May 10, 2006 12:04 PM
Subject: Re: Sum of counts
> Hi Chris, all,
>
>
EMAIL PROTECTED]>
Cc: "Rhino" <[EMAIL PROTECTED]>; "MySQL List"
Sent: Wednesday, May 10, 2006 12:04 PM
Subject: Re: Sum of counts
Hi Chris, all,
Re-inserting Chris' original question:
| I want to get a total of entries from four tables which all match a
| particu
Hi Chris, all,
Re-inserting Chris' original question:
| I want to get a total of entries from four tables which all match a
| particular id. The result for the id I'm testing (21) should be 233.
| In my naivety, I thought something like this would work:
|
| select count(a.id) + count(b.id) + cou
At 13:28 -0400 9/5/06, Rhino wrote:
The reason you are getting so many rows has nothing to do with the
way you are using the count(*) function and adding the different
count() results together. The problem is that you are doing your
joins incorrectly... In your case, I think you need to change
- Original Message -
From: "Chris Sansom" <[EMAIL PROTECTED]>
To: "MySQL List"
Sent: Tuesday, May 09, 2006 11:47 AM
Subject: Sum of counts
Here comes a newbie question...
I want to get a total of entries from four tables which all match a
particular id. The result for the id I'm t