Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 216485

Combine unique ids and turning columns into rows

$
0
0

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:

IDTag Name
1Banner
1English
2People
2Infographic
2Arabic
3English

 

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:

IDTag1Tag2Tag3
1BannerEnglishnull
2PeopleInfographic Arabic
3Englishnullnull

or 

IDBannerEnglishPeopleInfographicArabic
111nullnullnull
2nullnull111
3null1nullnullnull

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!


Viewing all articles
Browse latest Browse all 216485

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>