Monday, May 6, 2013

tsql - is there a better way for these queries

table topics (tcode,tname)


table articles (acode,aname)


table article_topics (acode,tcode) N:N relationship


case 1 top 2 articles for every topic


case 2 top 2 articles for every topic with the limitation that every article only appears once regardless of how many topics is heads the topic list. I dont care which topic gets the honor of having the article as its member so long as on one topic claims it in the result set. (or the topic can be prioritized to determine which one gets to claim the article




???


No comments:

Post a Comment