"Kristian Damm Jensen" <kristiandammNO@SPAMyahoo.dk> skrev i en meddelelse
news:43eba89a$0$78284$157c6196@dreader1.cybercity.dk...
> EnjoyNews wrote:
> > I 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
>
> select *
> from songs s1
> join songs w2
> on s1.cdID = s2.cdID
> where s1.songID = 3
> and s2.songID = 4
>
> P.S. Hvorfor skrive på engelsk i en dansk gruppe?
>
>
> --
> Kristian Damm Jensen
Super det virker.. mange mange tak..
Nu kan jeg sove igen
Undskyld den blev på engelsk.
Det var fordi jeg lige havde postet den på et engelsk forum, hvor der ikke
blev svaret.
Så synes jeg ikke lige jeg gad oversætte den. Jeg tænkte at I nok kunne
engelsk.