CREATE DEFINER=`root`@`%` FUNCTION CalSoldeClient (vID_Cli int) RETURNS double
DETERMINISTIC
BEGIN
DECLARE Solde Double;
select sum(Mt_Reg) SumMtReg from t_regcli where id_Cli = vID_Cli;
select sum(Mt_Credit) SumMtCredit from t_credit where id_Cli = vID_Cli;
select SoldeInit from t_clients where id = vID_Cli;
set Solde = SumMtReg - (SumMtCredit + SoldeInit);
RETURN Solde;
END
ERROR 1415:不允许从函数返回结果集