Problems with getting the right data ?
am 08.02.2006 12:50:28 von EnjoyNewsI have some tables that is connected in a table like this:
TracklistID
CDid
SongID
it could look like this
1 1 1
2 1 2
3 1 3
4 1 4
5 2 3
6 2 4
7 2 5
8 3 4
So CD 1 has the four tracks 1,2,3 and 4
CD 2 has three tracks 2,4 and 6
and CD 3 has the one track 4
Then I can list the albums that contains track 3 very simple ofcause by typr
WHERE SongID='3'
But now I want to do a search on which albums contains to different songs.
Ex. which albums contain track 3 and 4
If I type WHERE SongID='3' AND SongID='4' it doesn't work because no posts
has two songid's ofcause.
And if I type WHERE SongID='3' OR SongID='4' it doesn't work because it then
includes CD 3 because it has one of the tracks.
So how do I get it to list the CD's that has both track 3 and 4 in it ??
best
Michael