I need the top X records, if more then X records could be considered the
top, I just need X records based on any other order of convenience.

For example:
NAME    VIEWS
rec1    4
rec2    3
rec3    3
rec4    3

In this case, I would want rec1 and any one of the following 3.

Another example:
NAME    VIEWS   
rec1    5
rec2    5
rec3    5
rec4    3

In this case, I would want any two of the first three records, either
random, alphabetically, or unordered would be fine.

Thank You

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA


-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003 3:51 AM
To: CF-Talk
Subject: Re: Select TOP X form all Groups


Ian Skinner wrote:
> I have a table something like the below.  I would like to create a select
> that will retrieve the TOP 2 records for each category?  I can't seem to
get
> my head around this one, is it really that difficult?
> 
> Desired Results:
> TYPE          NAME    VIEWS
> Campground    X       4
> Campground    Bar     3

So which results do you want if there are 3 names with the same 
number of views?

Jochem



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to