I have two tables (its a message board). One table is Topics, the other is TopicPostings. Topics contains the title of each discussion, date created etc and has ID called "TID". TopicPostings has all the postings.. it has a unique id "TPID", and also a "TID" column so i know which topic the posting belongs to.
What i want to do is display all the topics a member has posted in. A member though may have posted in a topic several times, so I only want to display that topic once, not 4, 5, 6 or however many times they posted to that topic.
I tried this below but it didn't work.
I even tried removing the inner join and i just tried to get the distinct working on just TopicPostings, but still it brought up multiple results for topics that shared the same TID.. whats up!??
What i want to do is display all the topics a member has posted in. A member though may have posted in a topic several times, so I only want to display that topic once, not 4, 5, 6 or however many times they posted to that topic.
I tried this below but it didn't work.
Code:
SELECT DISTINCT TopicPostings.TID, Topics.Subject
From TopicPostings
Inner join Topics
on TopicPostings.TID = Topics.TID
Where TopicPostings.MemberID = @memberID
I even tried removing the inner join and i just tried to get the distinct working on just TopicPostings, but still it brought up multiple results for topics that shared the same TID.. whats up!??