I have made a database structure where users can make “friend connection” between them like on facebook.
Every user can save text to tbl_Statuses table and only their friends can see this messages.
But I have trouble with SQL 🙁
tbl_Friends{UserId, FriendId, Accepted}
tbl_Statuses{StatusId, Text, UserId}
I’am trying to get statuses:
– That I write
– That my friends write
I have tried something but I can’t figure 🙁
select s.*
from tbl_Statuses s left join tbl_Friends f on s.userId = f.UserId
where s.userId = f.UserId
1 Answer