Error in MYSQL: syntax error missing 'semicolon' [closed]

2

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:[email protected] ;
 set can_adeudado:[email protected]:adeudado ;
END &&
delimiter ;

The error is marked in the clause WHERE of the first SELECT .

    
asked by Maca Igoillo 20.10.2016 в 01:52
source

1 answer

1

The bug seems to be in this row that you separate it with a comma:

where c.fecha_pago<=fecha_ahora , c.dni=dni_alum and c.fecha_pago is not null;

should be with and

where c.fecha_pago<=fecha_ahora and c.dni=dni_alum and c.fecha_pago is not null;
    
answered by 20.10.2016 в 02:27