You are here: 10 Random records, 1 from each category « MsSQL Server « IT news, forums, messages
10 Random records, 1 from each category

Posted by FrankEBailey on 12/01/06 12:44

I'm not sure if this is a completely dumb question, but please humor me
:) I have a table of records, called Records, each of which has a
Category_ID that places it in a specific category; the details of the
categories are stored in another table called Category. What I need to
do is retrieve a recordset that contains one record from each category,
but where the records that are retrieved are random. I know how to
retrieve one or more random records using "order by NewID()", but have
not been able to work out how to get one random record from each
category.

Any assistance in this puzzler will be HUGELY appreciated!

Thanks
FEB

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация