Forum Discussion

hlio's avatar
hlio
Mentor
8 years ago

LiQL question about selecting from ancestor category

Hello I'm trying to select the top 5 TKB articles with a specific label, but only within our Japan Category not our English category.

 

I'm not sure how to include the ancestor_categories.id field when pulling from the messages table, and I don't believe the way I'm doing it below is correct.

SELECT subject, view_href FROM messages WHERE labels.text='example' AND conversation.style='tkb' AND conversation.featured = false AND ancestor_categories.id = 'Japan' ORDER BY metrics.views DESC LIMIT 5" />

 

Can anyone help out? Appreciate any quick responses our suggestions!

2 Replies