Hi SQL-Community
 
I need once more your help, I have a tricky problem with my animal-db.
 
I have a table with animals and a table with animal-pics. I have a third
table. In this table you can see, which pic belongs to which animal:
 
CREATE TABLE animal (
  id int(11) NOT NULL auto_increment,
  animal varchar(250) NULL,
  PRIMARY KEY  (id)
);
CREATE TABLE pic (
  id int(11) NOT NULL auto_increment,
  pic varchar(250) NULL,
  PRIMARY KEY  (id)
);
CREATE TABLE animal_pic (
  animalid int(11)  NULL ,
  picid int(11) NULL
);
 
The problem is now, that there can be n pics for an animal!
 
With which join can I show the animals with all pics for this animal (even
if there are more than one pic for an animal)?
 
Thank you for you ideas!
 
Martin

Reply via email to