I have a list of post IDs from WordPress and tags associated with them. Currenlty if there are multiple tags per post then that post has multiple entries:
ID | Tag Name |
1 | Banner |
1 | English |
2 | People |
2 | Infographic |
2 | Arabic |
3 | English |
I would like to filter out all the posts that don't have an English Tag so I would only keep post 1 and 3.
The way I thought about doing this is combining the ID rows like this:
ID | Tag1 | Tag2 | Tag3 |
1 | Banner | English | null |
2 | People | Infographic | Arabic |
3 | English | null | null |
or
ID | Banner | English | People | Infographic | Arabic |
1 | 1 | 1 | null | null | null |
2 | null | null | 1 | 1 | 1 |
3 | null | 1 | null | null | null |
and filtering out posts that are not in English.
What are the Queries/transformations that would get me to those last two tables?
Alternatively, is there a better way to filter out all non-English posts?
Thanks!