spand
INSERT INTO Tbl (parentId, number) VALUES (42, COALESCE((SELECT MAX(aTbl.number) FROM Tbl as aTbl WHERE aTbl.parentId = 42) + 1, 1) );