Thanks for your reply, John, but that query will only return one row for each match. Perhaps I wasn't clear. If I have data:
Deck (DeckID, DeckName):
1 sacham's deck
2 your deck
DeckCard (DeckID, CardID, Count):
1 1 1
1 2 2
2 3 1
2 4 4
Card (CardID, CardName):
1 Ace
2 Jack
3 Seven
4 Ten
Then, conceptually, deck #1 has 3 cards in it: an ace and two jacks. Deck #2 has 5 cards in it: a seven and four tens. I need a query that will allow me to return a list of cards in a given deck. So, a query on deck #1 would return:
Ace
Jack
Jack
And on deck #2:
Seven
Ten
Ten
Ten
Ten
A kludgey way of doing this (and the way I'm doing it right now) would be to use UNION ALL, as follows (pseudo-SQL):
get all cards in decks that have a count >= 1
UNION ALL
get all cards in decks that have a count >= 2
UNION ALL
get all cards in decks that have a count >= 3
...etc
Unfortunately, this only works if you have a reasonably bounded count. I would like a general way to do this.
sacha