I have a table with languages of persons. Any person can either speak English, Spanish or both English and Spanish. In the first two cases I have one row per person_id, in the second I have two rows.
I need to use this data in another table but I can only retain one unique row per person. The correct solution in my case is to create two columns:
Select
person_id,
case when person_language = 'English' then person_language end as "english_language",
case when person_language = 'Spanish' then person_language end as "spanish_language"
from person_table;
This gets the right data into the right column, but the English & Spanish are each shown on two separate rows having a NULL value in the other language column. Any idea on how to solve this?