SELECT dealerid, count(dealerid) AS Instances
FROM yourtable
GROUP BY dealerid
If you don't want to run the query to often use cachewithin in the query
parameters like
<cfquery name="somequery" datasource="mydsn" cachewithin="0.25">
0.25 is 6 hours but you can change that value to anything you like or use a
createtimespan() if you prefer.
--
Jay
> -----Original Message-----
> From: Asim Manzur [mailto:[EMAIL PROTECTED]
> Sent: 13 September 2004 16:04
> To: CF-Talk
> Subject: DISTINCT alternative
>
> I have seprate table to stats.
> When any dealer create the Ad, a field inserted in table for
> reporting.
>
> that table have id, created, dealerid, name, template
>
> I need to create a bar graph and show the report.
>
> I don't wanna run the query too many times.
>
> is there any way that I just run the query once and it tell
> me which dealer have how many enteries in table?
>
> thanks
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

