I am doing a function in MySQL however when I try to record it it does not allow me and the error comes out within the following IF.
/* Verifica que el empleado esté excento */
IF SELECT Count(*) FROM ExcentosDedApo
WHERE(CvePersonal=CvePersonal)AND(Clave=CveDedApo)>0
THEN
RETURN 0;
END IF;
The error message that comes out is
MySQL ha dicho: #1064 - Algo está equivocado en su sintax cerca 'SELECT Count(*) FROM ExcentosDedApo WHERE(CvePersonal=CvePersonal)AND(Clave=C...' en la linea 7
I already found the error I put it in case someone needs it on occasion, the problem was the parentheses