[nycphp-talk] SQL Select
bdailey at jaysec.com
Tue Oct 17 12:32:09 EDT 2006
I assume you're using MySQL?
select count(ID), COUNTRY from tablename group by country;
Hope that helps!
- B. D.
Date: Mon, 16 Oct 2006 14:05:38 -0400
From: "Peter Sawczynec" <ps at pswebcode.com>
Subject: [nycphp-talk] SQL Select
To: "'Org, Talk at Nyphp.'" <talk at lists.nyphp.org>
Message-ID: <002f01c6f14d$af891410$6701a8c0 at SUNCODE1>
Content-Type: text/plain; charset="iso-8859-1"
If I have a table with fields roughly like:
ID NAME ADDRESS CITY STATE COUNTRY
I would like to do a select that would give me output grouped like so
(including the quantity):
United States (1589)
New York (1200)
Los Angeles (200)
Thanks in advance if you've got this at your fingertips.
_Design & Interface
ps at pswebcode.com
More information about the talk