Michael,

One thing to take into consideration, is that your first query although
might be small now. Can you guarantee that it is not going to grow into the
thousand of millions?

The reason I mention this, is because you should return the records as
minimally as possible to begin with. I understand that you question might be
an example to illustrate your point, but just in case you don't I think it
is important even for others who might come across this post.



-- 
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273




-----Original 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...) The data will eventually populate a cfchart. 

my first query is as follows:

<cfquery name="initial" datasource="#DSN#"
SELECT id, state FROM users
</cfquery>

This gives me a result of about 100 rows (each user's state)

Im having troube formulating the second query. This is what I have so far

<cfquery dbtype="query" name="final">
SELECT * FROM initial, users WHERE id = users.id AND state = users.state
</cfquery>

But logically they are idential in nature...Im missing something. Can
anybody please point me in the right direction. I need to sum up every
instance of a state and return that as a number? Any help is appreciated!! 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311170
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to