q: I want to pull a distinct list of "content" that have a "category" (we have a content_categories table linking content ids with category ids), BUT I want it to be able to work from multiple categories in an AND fashion.

the table structure is, roughly:

content:
 id
 name
 blahblahblah

content_categories:
 content_id
 category_id

categories:
 id
 name
 blahblahblah

Eg:

"give me all content with categories animal (id 3) AND vegetable (id 5) AND mineral (id 9)"

If it's an OR process, it's easy -

SELECT DISTINCT blah blah ... AND c.catid in (10,9,23,11)

- but that's effectively an OR search, which is not what I want.

note: please cc me on list replies, cause I'm on the digest!

thanks,
sm

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to