At 18:31 -0400 6/12/03, Becoming Digital wrote:
> >>select SUM(IF(C=1,1,0)) AS VIEW_1, SUM(IF(C=2,1,0)) AS VIEW_2,
>>SUM(IF(C=3,1,0)) AS VIEW_3, count(*) as C from object_hist where
>>type_id=5879 group by object_id
and it complains about unknown column C. Anyone have any insite on how to
do
0)) AS VIEW_3
from object_hist
where type_id=5879
group by object_id
Edward Dudlik
Becoming Digital
www.becomingdigital.com
- Original Message -
From: "Christopher Knight" <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Thursday, 12 June, 2003
ist
where type_id=5879
group by object_id
Edward Dudlik
Becoming Digital
www.becomingdigital.com
- Original Message -
From: "Christopher Knight" <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Thursday, 12 June, 2003 11:22
Subject: sum on cou
Can you sum on counts?
What I want is the # of objects with a freq of 1, freq of 2, freq of 3...
and then total # of objects.
>>select object_id from object_hist where type_id=5879;
+---+
| object_id |
+---+
| 2121 |
| 3234 |
| 2121 |
| 4876 |
|