Query HELP!!!
How does distinct work? I need a query to return me the most recent replies by a specified User and well,
to put it simple, i can't do it!
lets take a simple table called Replies.
Table: Replies
Fields:
ReplyID
ArticleID
AccountID
PostDate
UpdateDate
NickName
Email
Well, i need a query like:
SELECT Distinct Top 5 ReplyID, ArticleID, AccountID, PostDate, NickName FROM
Replies WHERE AccountID=1 ORDER BY PostDate Desc
Well if you can already guess that when the person with accountid of 1 replies to an article
more than 1 time, then that entry with that articleID will show up twice in the top 5 query which i
don't need!! I need the top 5 most recent articles that have benn posted to with no duplicates entries, just
the top 5 articles they have posted to no matter how many times they responded to an article.
thanks
|