Hi
Mit etwas herumprobieren bin ich doch noch auf die Lösung gekommen:
CREATE TRIGGER triggername BEFORE INSERT ON tabelle
FOR EACH ROW SET NEW.spalte = (SELECT IF(MAX(spalte),MAX(spalte),0)+1 FROM tabelle);
mfg
Felix
Hi
Mit etwas herumprobieren bin ich doch noch auf die Lösung gekommen:
CREATE TRIGGER triggername BEFORE INSERT ON tabelle
FOR EACH ROW SET NEW.spalte = (SELECT IF(MAX(spalte),MAX(spalte),0)+1 FROM tabelle);
mfg
Felix