Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table users
- id_user name
- 1 A
- 2 B
- 3 C
- 4 D
- 5 E
- table community
- id_follower id_followed
- 1 2
- 1 3
- 1 5
- table posts
- id_post id_user_post post
- 1 2 hi
- 2 3 hello
- 3 5 hey you
- 4 4 come on
- 5 5 where are you
- SELECT u.name as n, p.post as t
- FROM community as c
- LEFT JOIN users as u ON u.id_user=c.id_followed
- LEFT JOIN posts as p ON c.id_followed=p.id_user_post
- WHERE u.id_follower=1
Add Comment
Please, Sign In to add comment