Assuming you're keeping track of page views in the table you're talking about, just do a query like this:
SELECT COUNTER, TITLE FROM TABLE ORDER BY COUNTER DESC Then do a CFOUTPUT with Maxrows = the number of pages you want to show: COUNTER: TITLE COUNTER: TITLE Etc. I may be missing something, but this should do it... -----Original Message----- From: Paul Sinclair [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 1:39 PM To: CF-Talk Subject: SQL ?: Counting number of times for this I'm preparing a simple homebrewed site statistics report for a client. I need to send a cfmail each night showing the top pages viewed in various areas of the site. I'm stumped on how to get the info I need from the db. The table involved is a simple 5 column table. I just need to do a sql query that will look at the table and figure out which pages were viewed the most times during the previous 24 hours and then output the list of most popular pages in descending order of popularity. How do I do the query that will pull that out? I've tried all manner of bizarre combinations with the various aggregate functions. I think I've lost site of the forest through the trees here. Thanks, Paul Sinclair ______________________________________________________________________ Why Share? Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

