Re: a Count() ?
| From: | Pierre-Alain Joye | Date: | Sat, 16 Mar 2002 13:36:25 +0000 |
| Subject: | Re: a Count() ? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17713@lists.php.net to get a copy of this message | ||
On Sat, 16 Mar 2002 11:50:11 -0000
"DL Neil" <PHPml@DandE.HomeChoice.co.uk> wrote:
> Hi Dave,
> SELECT * FROM tblNm;
> SELECT * FROM tblNm GROUP BY Catid1;
> SELECT Catid1, count(*) FROM tblNm GROUP BY Catid1;
>
> As I said 'follow your instincts' and take it one step at a time: Code
> the simplest query first, then try making it more complicated by
> adding/amending one clause at a time, crafting the result until it suits
> your purposes...
Nothing to say except you have to avoid use '*'. That makes your queries easier to read
and will safe your db engine :).
pa