Query of Quries - Cfchart

2008-08-18 Thread Michael Fisher
Hi, I am trying to establish a QofQ to determine the following: I need to know how many people live in any given state (30 in California, 10 in Arizona...) The data will eventually populate a cfchart. my first query is as follows: cfquery name=initial datasource=#DSN# SELECT id, state FROM

Re: Query of Quries - Cfchart

2008-08-18 Thread Dominic Watson
I think you need to look at GROUP BY which will let you write just one query to the db, ie. SELECT Count(id) as nUsers, state FROM users GROUP BY state HTH Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and

Re: Query of Quries - Cfchart

2008-08-18 Thread Michael Fisher
I think you need to look at GROUP BY which will let you write just one query to the db, ie. SELECT Count(id) as nUsers, state FROM users GROUP BY state HTH Dominic That did the trick. Count along with Group worked great! Thanks!!

RE: Query of Quries - Cfchart

2008-08-18 Thread Andrew Scott
Message- From: Michael Fisher [mailto:[EMAIL PROTECTED] Sent: Monday, 18 August 2008 8:04 PM To: CF-Talk Subject: Query of Quries - Cfchart Hi, I am trying to establish a QofQ to determine the following: I need to know how many people live in any given state (30 in California, 10 in Arizona