I have a table like the example below.
+--------+--------+
| name | answer |
+--------+--------+
| John | yes |
| Dilan | yes |
| Dilan | no |
| Amanda | no |
+--------+--------+
I need to reorganize the table in a way that I have distinct values in name column and the answer column split in two columns, the answer_yes and answer_no, matching the related answers from the original table.
+--------+------------+-----------+
| name | answer_yes | answer_no |
+--------+------------+-----------+
| John | yes | |
| Dilan | yes | no |
| Amanda | | no |
+--------+------------+-----------+
I am guessing I have to use some function that search for the values yes and no through the answer column, but I didn't find what function does this work... how can I make it?