Lets say I have a table of articles with as many to many relationship with topics. Each topic assigned to an article has a type field which can contain 1 of 3 v
type
If I get this correctly
SELECT * FROM ArticleTopics where type = 'AND' UNION SELECT * FROM ArticleTopics where type = 'OR' limit 1
I assume by 'any' you mean 'any one'. You can join the articles to topics yourself, that's trivial.