"strawberry" <zac.carey@gmail.com> wrote in message
news:1148396850.646974.202020@38g2000cwa.googlegroups.com...
> SELECT brand,SUM(dnote) FROM $table GROUP BY brand;
>
> You could probably combine this with the above into a single query.
> Otherwise do a "SELECT CREATE VIEW" on your first table.