Select top 6 imageID >From table Where gameID = whatever Order by newid()
Or just... Select imageid >From table Where gameID = whatever Order by newID() And use maxrows="6" attribute of the cfquery tag. Just flip imageid and gameid for the other way around. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -----Original Message----- From: Dennis Powers [mailto:[EMAIL PROTECTED] Sent: Monday, October 08, 2007 6:30 PM To: CF-Talk Subject: RE: SQL Select Question >> What RDBMS? That would help mucho... Doh! MS SQL2000 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/ -----Original Message----- From: Greg Morphis [mailto:[EMAIL PROTECTED] Sent: Monday, October 08, 2007 6:14 PM To: CF-Talk Subject: Re: SQL Select Question What RDBMS? That would help mucho... On 10/8/07, Dennis Powers <[EMAIL PROTECTED]> wrote: > 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/ > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290646 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

