Re: Count and sum??
| From: | Michael Howitz | Date: | Thu, 03 Aug 2000 02:20:22 +0000 |
| Subject: | Re: Count and sum?? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1742@lists.php.net to get a copy of this message | ||
count:
select count(*)
from <table>
where <condition>
sum:
select sum(<column>)
from <table>
where <condition>
hope this helps,
mac
Shannon Doyle wrote:
>
> Hi Guys,
>
> Small question,
>
> Using a MYSQL query I need to return a count of the number of entries in my
> MYSQL database that meet a certain criteria, and for the life of me I cannot
> seem to get the count function to work for me. What is the best way to
> return such a value?
>
> Also I am wanting to obtain a sum of the values entered in the database that
> meet acertain criteria. (ie they are numerals and I need to add them up)
> Easy way for this too??
> Any help on these would be great as I cant seem to get count to work, and I
> am not sure on how to go about getting a sum to happen.
>
> - Shannon