I am new in Asp.net now i want to try to start a social network project
I have 3 tables
User
Userid -Username -Email -Password -Name -Profilepic
Post
-Postid -Content -Postdate -Userid
Friendlist
Friendlistid - userid - friendid -status
i want to load the post that from my friend and myself
This is my sql code
select b.userid, a.Friendid, c.name, b.postid, b.Content, b.postdate, c.profilepic
from friendlist a
left join [user] c on a.friendid = c.userid
left join post b on a.friendid = b.userid
where a.userid = 1 AND a.Status = 1 OR a.Userid = 1
ORDER BY postid desc
The problem that i faced was my post will repeat
For example, my friendlist table has 3 friends, my every single post will repeat 3 times and my friend post stay normal.
Any solution for this sql code?