Hi Dennis,

This should be very easy:
SELECT DISTING imageid, gameid
FROM    tblX
ORDER BY imageid+Rand()
LIMIT 6

By the way, the "LIMIT 6" is MySQL. You'd need to use "TOP 6" in SQL Server.

Hope this helps.
CHeers
Matthew

>I am having a total mental block with this select query and I am hoping
>someone might be able to "unstick" my thought process;
>
>I have a table Looking something like this (abbreviated for the list)
>
>ImageID  GameID
>
>ImageID is a unique ID number and there can be multiple images for each
>GameID.  What I am trying to do is create a query where I can select 6
>random imageID's each for a different GameID. Or another way, get one image
>from the many for six different gameID's
>
>Any help would be greatly appreciated.
>
>
>
>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/ 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

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