I have three tables like this:
Person
id | name | location ----------------------- 1 | ABC | Location1 2 | XYZ | Location2 Contact
id | type | contact --------------------------- 1 | website | abc.com 2 | email | [email protected] 3 | website | xyz.com 4 | email | [email protected] PersonContact
Person_id | Contact_id ----------------------- 1 | 1 1 | 2 2 | 3 2 | 4 I want to get result something like this:
id | name | website | email ---------------------------------- 1 | ABC | abc.com | [email protected] 2 | XYZ | xyz.com | [email protected]