Re: counting a value REVISED pt2
| From: | Micah Stevens | Date: | Sat, 31 Jan 2004 04:26:43 +0000 |
| Subject: | Re: counting a value REVISED pt2 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32731@lists.php.net to get a copy of this message | ||
select count(FavNum) as Favorite where FavNum = 2;
On Fri January 30 2004 8:19 pm, js wrote:
> p.s.- im using PHP with MySQL... if that helps any. thanks
> i want to know what i can use to count the number of times a value appears
> in a column listing where different values are listed. for example, say in
> the column of Favorite Number we have 100 students, and for each student
> his or her own row. and each student can pick a number from 1-10. So, we
> have a column of 100 rows and each field can contain either 1-10. Now, i
> want to know how can i count the number of times lets say the #2 appears
> in this list and give that count a number. so if #2 appears 43 times in
> that column, then i want it to say "2 is listed 43 times." how do i do
> this? thank you for your help with my beginner newbie questions. -james