Forum Discussion
- OlivierSLithium Alumni (Retired)
dustin I haven't checked the documentation but I think you can use the clause 'IN', so:
SELECT * FROM messages WHERE category.id IN ('xxxxxxxx','yyyyyyyy','zzzzzzzz') AND depth=0 ORDER BY post_time DESC LIMIT 15
It's not the best has you might add categories in the future, or you might have a long list of categories ...
Another option is to run your request for all categories, then add a if statement to eliminate everything from your test category.
SELECT * FROM messages WHERE depth=0 ORDER BY post_time DESC LIMIT 15
This isn't the correct freemarker syntax, just an idea: if message.board.id != 'test' then {do what you want to do with your messages }
- cikeChampion
dustin - Unfortunately, the current API versions do not offer a NOT operator to exclude boards or categories from calls.
SELECT * FROM messages WHERE category.id NOT IN ('xxxxxxxx','yyyyyyyy','zzzzzzzz')
So currently, the only ways to exclude boards are described within the reply from OlivierS.
I created an idea for this: http://community.lithium.com/t5/Product-Ideas/quot-NOT-IN-quot-operator-for-APIv2/idi-p/218558
Best,
Christian
Related Content
- 4 years ago
- 2 years ago
- 4 years ago