You are here: brain teaser - stagger the order of the results « MsSQL Server « IT news, forums, messages
brain teaser - stagger the order of the results

Posted by mjweiner on 09/05/05 14:15

This one has been stumping me for several days. I can run a query that
returns several different items from several different manufacturers,
each with a ranking score. Each manufacturer can have any number of
items:

Item_Name Manufacturer rank
Item 1 Manu_A 82
Item 2 Manu_A 65
Item 3 Manu_A 41
Item 4 Manu_B 32
Item 5 Manu_C 21
Item 6 Manu_B 19

However, I would like the records to be ordered so that the highest
ranking item is shown first, then the next highest item from a
different manufacturer is shown second, then the next highest item from
a third manufacturer is show, etc.:

Item 1 Manu_A 82
Item 4 Manu_B 32
Item 5 Manu_C 21
Item 2 Manu_A 65
Item 6 Manu_B 19
Item 3 Manu_A 41

Does anyone have any thoughts on how to order the results in this
fashion?

thanks,

Matt Weiner

 

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

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