I have a stats table that has all the regular stuff plus a personID field.
How would I create a list the last 10 people to visit without getting
repeated personIDs?
How would I create a list of the 10 people who have visited most often in
the last month in order of how often they've visited?

I've been working on these two things for months now... with the help of
many people.

I'm using Access 2000 for my DB... one thing we've found out is that
DISTINCT operates on all fields in SELECT... or at least with all the
methods we've tried so far.

Anyone who answers these questions to the point that I use the code on my
site gets a credit under the results on my home page :)

Thanks!!!
---
defective david
http://defective.net

----- Original Message -----
From: "Pete Freitag" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, October 16, 2000 7:28 PM
Subject: RE: returning top 10


> SELECT student_pop, COUNT(*) AS s_count
> FROM table
> GROUP BY student_pop
>
> I am assuming your table looks like this...
>
> Blah   student_pop
> ------------------------
> Blah   Towns
> Blah   Unions
> Blah   Towns
> Blah   Towns
> Blah   Towns
>
> The above query would return...
>
> student_pop   s_count
> ----------------------------
> Towns         4
> Unions        1
>
> That should get you going in the right direction, you are going to need to
> Order the s_count column, and then do a MAXROWS=10 to get the top ten.
>
> ______________________________________________
> Pete Freitag ([EMAIL PROTECTED])
> CFDEV.COM / NETDesign Inc.
> ColdFusion Developer Resources
> http://www.cfdev.com/
>
> -----Original Message-----
> From: Jim Watkins [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 16, 2000 9:39 PM
> To: CF-Talk
> Subject: RE: returning top 10
>
>
> What I mean is I do not want to hard code the top ten in.  I want Cold
> Fusion/Oracle to determine what the top ten are from say a list of 60.
>
> -----Original Message-----
> From: Shawnea Carter [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 16, 2000 9:15 PM
> To: CF-Talk
> Subject: RE: returning top 10
>
>
> Select top 10 * (or your fields)
> FROM table
> WHERE blah blah blah and student_pop
>
in('Towns','Union','White','Fannin','Habersham','Stephens','Rabun','Franklin
> ','Bibb','Jones')
>
> -----Original Message-----
> From: Jim Watkins [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 16, 2000 9:09 PM
> To: CF-Talk
> Subject: returning top 10
>
>
> How do you write a SQL statement that will return the top 10 of something
> (eg. top 10 salaries, top ten students by GPA, top ten populated counties,
> etc.)?
>
> Currently I have:
> and student_pop
>
in('Towns','Union','White','Fannin','Habersham','Stephens','Rabun','Franklin
> ','Bibb','Jones')
>
>
> --------------------------------------------------------------------------
--
> --
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
--
> --
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
--
> --
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to