I have a table Lets say “TopicComments” which records each comments from every user on a topic. The table has TopicID and UserID as foreign keys and comment date and comment text. So for each user comment, there will be a record with TopicID, UserID, DateTime, and text.
i want to retrieve the topics with most amount of comments within lets say 5 days. Im not the guy with best SQL skills, so im kind of stuck here. Any help would be appreciated. Not sure if my question makes too much sense.
thanks in advance.
Not mentioning the RDBMS, lets say MS SQL
So a full example would look something like
Results
To select the TOP 1 would then be
EDIT
Use somthing like