I have the following query in MySQL
delimiter //
create procedure notas(nota float)
begin
if (nota >= 0.0 and < 5.0) then
select 'Insuficiente' as Nota;
elseif (nota >= 5.0 and < 6.0) then
select 'Aprobado' as Nota;
elseif (nota >= 6.0 and nota < 7.0) then
select 'Bien' as Nota;
elseif (nota >= 7.0 and nota < 9.0) then
select 'Notable' as Nota;
elseif (nota >= 9.0 and nota <= 10.0) then
select 'Sobresaliente' as Nota;
else
select 'Nota inválida' as Error;
end if;
end//
delimiter ;
It gives me a syntax error, I have tried removing the parentheses from the conditionals, I have also tried putting elif or else if instead of elseif but nothing I have tried works. Does anyone see what's wrong with me? Thanks in advance
Try like this:
The variable was missing after the
AND