I am making a query and the following error appears:
syntax error missing 'semicolon'
Here's the question:
delimiter &&
create procedure alumnos_pagos_deudas_a_fecha (in fecha_ahora date, in dni_alum int,OUT pagado FLOAT, OUT cant_adeudado INTEGER)
BEGIN
select @pagado:=sum(importe_pagado)
from cuotas c
where c.fecha_pago<=fecha_ahora , c.dni=dni_alum and c.fecha_pago is not null;
select @cant_adeudado:=count(*)
from cuotas c
where c.dni=dni_alum and c.fecha_emision<=fecha_ing and c.fecha_pago is null;
set pagado:=@pagado ;
set can_adeudado:=@cant:adeudado ;
END &&
delimiter ;
The error is marked in the clause WHERE
of the first SELECT
.