I have three tables:
Table1: Places (a place can have multiple contacts)
Columns: place_id, place_name, ...
Table2: Contacts (a contact can visit multiple places)
Columns: contact_id, contact_name, ...
Table3: PlacesContacts
Columns: id, place_id, contact_id
Then I want to get all users from a specific place then I can do something like:
select * from PlacesContacts where place_id = 3
I will get all contact_id's
I need but also I want to get all the contact_id's
data from Contacts
table.
What is the best possible way to achieve this?