Hi,
I have contact info stored in two tables. Each person in the people table has multiple pieces of contact info (phone number, email, etc.) in the info table. I can left join for multiple rows of fun (with repeating person details) like this:
SELECT p.first_name, p.last_name, i.info_type, i.info_content
FROM people p
LEFT JOIN info i ON i.person_id = p.id
resulting in something like this:
Bobola, Fossmosto, E,
[email protected]
Bobola, Fossmosto, P, +1.111.111.1111
How would I alter my query to get something like this?
first_name, last_name, c1_type, c1_content, c2_type, c2_content
Bobola, Fossmosto, E,
[email protected], P, +1.111.111.1111
Thanks for pointers in advance.