Re: COUNT(*) Output Question
| From: | Curt Zirzow | Date: | Mon, 02 Aug 2004 20:41:57 +0000 |
| Subject: | Re: COUNT(*) Output Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192493@lists.php.net to get a copy of this message | ||
* Thus wrote Tom Ray [Lists]:
> Hey-
>
> I'm query my mySQL database to see how many of each Sku has been
> ordered. I am doing my query as:
>
> $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku");
alias the count(*) column:
SELECT sku, COUNT(*) as qty FROM orders GROUP BY sku
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!