Here are my tables:
create table caddy(
Pnr char(13),
tips varchar(20),
name varchar(20),
primary key(Pnr)
)engine innodb;
create table golfbag(
brand varchar(20),
type varchar(20),
spelarePnr char(13),
caddyPnr char(13),
primary key(brand, spelarePnr),
foreign key(spelarePnr) references spelare(Pnr),
foreign key(caddyPnr) references caddy(Pnr)
)engine innodb;
as you can see, there's join between caddy and golfbag. and the join has to be this way, it cant be the other way around.
this is what i wanna do:
delete from caddy
where caddy.pnr="141414-1414" and caddy.name="Jeppe";
but I just get the error code 1451. what can the problem be?