谢谢,但如果使用变量 ::::: 像这样:
IF NOT EXISTS( SELECT ReferenceID as ExistedRefID FROM filesrefrences WHERE RefrenceKey= pRefrenceKey) THEN
INSERT INTO filesrefrences(RefrenceKey, RefrenceCount)
VALUES(pRefrenceKey,1);
SELECT LAST_INSERT_ID();
ELSE
UPDATE filesrefrences
SET RefrenceCount= RefrenceCount+1
WHERE ReferenceID= ExistedRefID;
SELECT ExistedRefID;
END IF
它指的是 ExistedRefID 未知的执行错误,我该如何解决这个问题