I have four tables: acting
, writing
, film
, tech
email | skill
-----------------------
foo@bar.com | acting
foo1@bar.com | acting
foo2@bar.com | acting
... | ...
email | skill
-----------------------
foo@bar.com | writing
foo7@bar.com | writing
foo8@bar.com | writing
... | ...
email | skill
-----------------------
foo4@bar.com | film
foo9@bar.com | film
foo12@bar.com | film
... | ...
email | skill
-----------------------
foo3@bar.com | tech
foo4@bar.com | tech
foo7@bar.com | tech
... | ...
I want to create a new table skills
, such that every email address is included, and the skills pertaining to each address are concatenated into the skill field.
email | skill
-----------------------
foo@bar.com | acting, writing
foo1@bar.com | writing, film
foo2@bar.com | acting, film, tech
... | ...
I've mucked around with full outer joins via union but I can't seem to get it right.
UPDATE: I realize how poorly these tables are designed. I am migrating data from a frankenstein legacy CRM with the above tables, and I need the values comma separated in the new table so I can import them into a new CRM.