Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query to restrict count by group

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-14 : 08:11:13
Jinu writes "Hi
I have a table strcutre as follows.This is like a many to many relationship between category and Article. Now i need to pick 3 recrord from each category which has a relavancy 1 sorted by Article date Desc. ie.. from the recent articles..
I can fire 4 diff queries and restrict it using top keyword..
Can i do this in a Single query or in a better way..can anyone help me plz......

Rgds
jinu

Category
---------
catID - PK
CatName

Article
-------
ArticleID - PK
Name
Date

Category_Article
----------------
ArticleID - Composite Key(ArticleID,CatId)
CatID
Relavancy "

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-12-14 : 09:24:53
this might be the solution to your problem.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=43677
Go to Top of Page
   

- Advertisement -