
Return varias variables funcion
Publicado por Diegin92 (10 intervenciones) el 10/05/2017 22:45:56
Como puedo hacer para que esta funcion me haga un return de las dos variables
No me deja crear otra variable donde junte ambos select, y sacar por return dicha variable :S
1
2
3
4
5
6
7
8
9
10
11
12
13
use empleados;
delimiter $$
drop function if exists calcularcostesalarial$$
create function calcularcostesalarial(departamento varchar(30)) returns int
begin
declare vselect int;
declare aux int;
set vselect=(
select sum(salario) from emple e join depart d on e.dept_no=d.dept_no where dnombre=departamento group by d.dnombre);
set aux=(select sum(comision) from emple e join depart d on e.dept_no=d.dept_no where dnombre=departamento group by d.dnombre);
return vselect,aux;
end$$
delimiter ;
No me deja crear otra variable donde junte ambos select, y sacar por return dicha variable :S
Valora esta pregunta


0