From: Peter Brawley Date: December 29 2006 3:21pm Subject: Re: Count the number of specific rows List-Archive: http://lists.mysql.com/mysql/204125 Message-Id: <4595327E.4060203@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit >I can simply use this : >SELECT id FROM sent WHERE member_id= ... >and the use count($result) to count the number, but I want a faster way, if >possible. SELECT COUNT(id) FROM sent WHERE member_id= ... PB Servers24 Network wrote: > Hi, > > Well this question may seem funny, but I really need to know! > The problem is with counting a user's contribution in my site. Suppose > that > each user that send an email will be stored in DB. Now I want to count > number of times that a user has sent an email. > I can simply use this : > SELECT id FROM sent WHERE member_id= ... > and the use count($result) to count the number, but I want a faster > way, if > possible. > Thanks > > PS : This is *MySQL 4.0.x* > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.409 / Virus Database: 268.15.29/607 - Release Date: 12/28/2006 > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.29/607 - Release Date: 12/28/2006