I have a table that can hold the id for entries of another table and I need to convert the rows from the second table into columns for a new view based on the first table. It is similar to what is done in this question, but I need it to be dynamic, i.e. instead of manually choosing email1, email2 and email3, it needs to get the rows from the second table and create columns based on that, which will hold boolean values if the row holds the id for the column.
For example, consider table A as
| entry_id | tags |
|---|---|
| 1uxs2NM7K6nx58z13WFiNq | descriptionReview |
| 1v5AKF9Z5VmBdAzObr0Xxs | titleReview |
| 1ZLV74fhn2kDqYi7R3XxEW | descriptionReview;titleReview |
and table B as
| id |
|---|
| descriptionReview |
| titleReview |
| subtitleReview |
The resulting view would look like this
| entry_id | descriptionReview | titleReview | subtitleReview |
|---|---|---|---|
| 1uxs2NM7K6nx58z13WFiNq | TRUE | FALSE | FALSE |
| 1v5AKF9Z5VmBdAzObr0Xxs | FALSE | TRUE | FALSE |
| 1ZLV74fhn2kDqYi7R3XxEW | TRUE | TRUE | FALSE |