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 |
|
mark-o
Starting Member
1 Post |
Posted - 2008-06-11 : 19:44:58
|
| I am looking to query one table where the matching information in the related table needs to be a subset of the data - but not always a complete set (and there may be added information in the related table). For example, if I have a table of Albums and I want to match songs to albums as follows:AlbumsName CHAR_TYPE CHARRock guitarists Genre RockRock guitarists Instrument GuitarGreat Guitar Instrument GuitarRock and Blues Genre RockRock and Blues Genre BluesSongsName CHAR_TYPE CHARPurple Haze Genre RockPurple Haze Instrument GuitarPurple Haze Artist HendrixRed House Genre BluesRed House Instrument GuitarRed House Artist HendrixStairway to heaven Genre RockStairway to heaven Instrument GuitarFor this query, the results should beAlbum SongRock guitarists Purple Haze & Staiway to HeavenGreat Guitar All 3 Rock and Blues All 3 Everything I've tried either incudes extra songs (Rock Guitar includes Red House) OR Eliminates entire albums (everything else works, but rock and Blues produces no resultsThanks in advance for any sugestions. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-12 : 00:57:10
|
| Not clear from your sample data the rules for matching. Can you elaborate? |
 |
|
|
|
|
|