-
Website
http://www.codespatter.com -
Original page
http://codespatter.com/2008/07/22/conditions-on-count-or-sum-in-mysql/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
billymcclure
1 comment · 1 points
-
Ben Bangert
1 comment · 2 points
-
jakubmusil
1 comment · 1 points
-
dobrych
1 comment · 1 points
-
Greg Allard
32 comments · 1 points
-
-
Popular Threads
myself suresh...a great programmer...if anybody needs help..just mail to me.
I have a table where i need SUM of a field as will as I have to COUNT total effected rows.
Any idea?
I just did it.
I used this:
SELECT count(products_id) as count_products , SUM( reviews_rating ) as total FROM TABLE WHERE products_id=".$product_id;