Let me get this straight, you want a report to summarize the number of
installs by date and client.  So client 1 ran 3 installs on 6/1 and 2
installs on 6/2.

I believe you simply need to group by hostname, and then date and then
use an aggregate function (count()) to add up the records in between
like so:

SELECT hostname, iDate, count(1)
FROM installs
GROUP BY hostname, iDate
ORDER BY hostname, iDate

The order by is optional, but I threw it in since your result set was
ordered that way.

Depending on whether or not your iDate column stores time or not, you
may need to convert it to date only.  (syntax depends on your DB).  

~Brad

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 26, 2007 10:16 PM
To: CF-Talk
Subject: SQL Help, please ...

Hello,
It's been a wile since I have had to do much in the way of SQL queries
and
I need some help.

I have a table called "installs" that looks like this

HostName, iDate, Package
client1, 2007-06-01, Update1
client1, 2007-06-01, Update2
client1, 2007-06-01, Update3
client1, 2007-06-02, Update5
client1, 2007-06-02, NewApp
client2, 2007-06-01, Update1
client2, 2007-06-01, Update2
client2, 2007-06-01, Update3
client2, 2007-06-02, Update5
client2, 2007-06-02, NewApp

What I want is a report/summary like result that looks like this

HostName, iDate, Installs
client1, 2007-06-01, 3
client1, 2007-06-02, 2
client2, 2007-06-01, 3
client2, 2007-06-02, 2

I hope this makes sense and I know this is off topic but any hep would
be
great.

Thanks,
tom

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

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

Reply via email to