Hi,
I'm building a database of radio stations, but have found that some stations have multiple formats (especially the college ones). So I did two tables, one for the basic radio information and one for the formats, both with a StationID as the key between them.
So say Station 1 can be:
Alternative
Jazz
Classical
Folk
News
Station 2 is:
Jazz
Blues
News
etc, etc.
The problem arises when I try to pull up a list of all Jazz stations and then list what other formats they play. Say "show me all the Jazz stations" and then create a list of other formats these stations play.
I made a subquery, selecting 1) all the stations that have Jazz and then 2) all of the formats for the above StationIDs.
That's where I get into a problem. In the prior example, I'd get a listing like this:
Jazz
Alternative
Classical
Folks
News
Jazz
Blues
News
Obviously the repeating part of this is a problem.
Does anyone have any ideas? I've looked at creating a temporary table with the results of the first search, but was wondering if there is any easier way.