我有这个存储过程,它已经工作了一段时间
CREATE PROCEDURE `ProjectFromTemplate`(
IN TemplateID INT,
IN NewProjectID INT
)
BEGIN
INSERT INTO Project_Stage
(
ProjectID,
StageID,
StageIndex,
Time
)
(
SELECT
NewProjectID,
StageID,
StageIndex,
Time
FROM Project_Stage
WHERE ProjectID = TemplateID
);
END
但是我决定在表中添加另一列,但我没有相应地更新程序。我希望该过程能够处理我添加的任何新行。我需要类似这样的伪 SQL
CREATE PROCEDURE `ProjectFromTemplate`(
IN TemplateID INT,
IN NewProjectID INT
)
BEGIN
INSERT INTO Project_Stage
(
ProjectID,
*
)
(
SELECT
NewProjectID,
*
FROM Project_Stage
WHERE ProjectID = TemplateID
);
END
有没有办法在 MySQL 中表达“所有后续行”之类的东西?