I'm creating this procedure to run once a day, as I have no experience, I got an error in the code below:
CREATE (definer omitido) PROCEDURE 'MULTAOFF'()
BEGIN
set @multado = (select 'CPFAluno' from multa where 'dataMultaFim' <=
CURDATE());
update aluno set 'StatusAluno' = '0' where @multado IN ('CPF') and
StatusAluno = '2';
END
As a result of calling Call MULTAOFF();
I get the following error:
Error Code: 1242. Subquery returns more than 1 row
What is happening and how can I resolve this?