I have 4 relationship tables in my database and you want to join them to get the general value ... for example, I have friends, relatives, acquaintances and acquaintances, and you want to join them to get the value "ALL" .
The format of the table is as follows:
Friends
id follower following --------------------- 1 2 3 2 4 5
A family
id follower following --------------------- 1 5 6 2 7 8
After
id follower following --------------------- 1 9 10 2 11 12
Acquaintances
id follower following --------------------- 1 13 14 2 15 16
The correct query to join all 4 tables ...
SELECT following FROM friends INNER JOIN family ON friends.following=family.following INNER JOIN following ON friends.following=following.following INNER JOIN acquaintances ON friends.following=acquaintances.following WHERE follower='id'
Basically, I want to join and get the "next" value from all four tables, where id = my id
source share