Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
designedit
Starting Member
1 Post |
Posted - 2007-10-01 : 06:43:45
|
| I think this question will be very easy for someone. I wondered what the "standard" way to do it is please?From TableA and TableB below (joined by BookID) I would like to select books which are in specific categories. I can see how to do this if I'm just selecting from one category. But how is it done for more than one category? For example, I would like to select all books once which are in both catID 23 AND catID 24, thus having a result set of:1 Trees4 CatsThese are the only books in both categories.TableABookID Title1 Trees2 Gardens3 Dogs4 CatsTableBID BookID CatID1 1 232 1 243 1 284 2 235 3 546 2 127 3 248 4 239 2 6710 4 24 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|