I apologize. I did not explain myself properly which I suspect is why I
can't figure this out.

>> Select top 6 imageID
>> From table
>> Where gameID = whatever
>> Order by newid()

This query will select 6 random images for a single GameID however, what I
am trying to do is select 1 random image for 6 different gameID's  which can
be random or by other selection criteria.  I have over simplified the table
to illustrate my dilemma.  Given a table like the one below I want to select
1 image for each of 6 gameIDs.  So far the only way I can see doing it is to
loop over a query that selects 1 image for a given GameID.

For argument sake let's assume I have a list of gameID's
(44,200,89,50,44,48)  How would I select one (1) random Image for each of
the gameID's from the table below in a select statement and without looping
over the query in CF?


Table:

ImageID   GameID
1               44
2               48
3               200
4               89
5               909
6               50
7               44
8               44
9               50
10              200
11              201
12              48
13              48
14              89




Best Regards,

Dennis Powers
UXB Internet - A website design and Hosting Company
690 Wolcott Road
P.O. Box 6029
Wolcott, CT  06716
Tel: (203)879-2844
http://www.uxbinternet.com/
http://www.uxb.net/ 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290684
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