When trying to update to include a price in the previous made table Abonnement I get the error code mentioned in the title. I looked around on the net but it seems my syntax is correct?
SET SQL_SAFE_UPDATES=0;
DELETE FROM Abonnement;
DELETE FROM AbonnementType;
INSERT INTO AbonnementType(beginDatum,eindDatum,type)
VALUES("2013/1/1","2013/1/1","DAGPAS");
INSERT INTO Abonnement(betaald,AbonnementType_ATypeId,FietsType_FType,Klant_klantId,Code,Wachtwoord)
VALUES(false,(SELECT MAX(ATypeId) FROM AbonnementType),1,1,"test","test");
UPDATE Abonnement as a
JOIN FietsType AS af ON a.FietsType_FType = af.FType
JOIN AbonnementType AS at ON a.AbonnementType_ATypeId = at.ATypeId
SET a.prijs = af.Prijs * (at.eindDatum + at.beginDatum)
ORDER BY AbonnementId DESC
LIMIT 1;