Question: How to select for books belong to cat2 and cat3? (that is book 2 and 3)

Possible solution: Is there anyway to "group" the table "books_cat" by bid, and somehow combine (concatenate or group) the field cid, just like the sum function for numbers. Then I can ask if the cat2 and 3 are included in the new, combined cid field. Hope this makes sense. Because I need to setup a search form, I don't know which cat or how many cat will be picked.

Any suggestion will be appreciated. Please help me! Thank you very much!

Thank you for the reply, Ihari. But your method will select books belonging to Cat2 OR Cat3. What I want is books belonging to both Cat2 AND Cat3.

I kind of having a solution but may not be very good. Use Ihari's method to get all books in Cat2 or Cat3. Add "group by bid". Count the number of Cat each bid has. The books have 2 Cat count are what I want. This is easy to say, but may not be easy to understand (it wasn't for me). Hope this solution can be helpful to others. If you got any better idea, please reply here. Thanks.

The way to do it would be something like :-
Table of books (Each has a unique ID)
Table of Catergorys (Each has a unique ID)
Another table, that has two columns, one is a book id and one is a catergory id.

You can have multiple book ID's all pointing to a different catergory.

Carpe Diem: yes, this is how I setup the tables. But my question is for something else and I have a solution for that (see post above). But it may not be a good one and I would love to hear some new ideas.