에서 저장 프로 시저를 만드는 다음 코드가 mysql
있습니다.
mysql>delimiter |
mysql>create procedure GetCustomerLevel()
-> if(select count(name) from s_marks)<4
-> then
-> begin
-> select 'inside the if statement' as'';
-> select 'there are lassee than 4 students' as '';
-> end
-> else
-> select 'there are more than 4 stu' as '';
-> end if|
하지만이 오류가 발생합니다.
오류 1064 (42000) : SQL 구문에 오류가 있습니다. MySQL 서버 버전에 해당하는 매뉴얼에서 'else select'there are more than 4 stu 'as' '근처에서 사용할 올바른 구문을 확인하십시오. 15 번 줄에서 끝
내가 뭘 잘못하고 있니? 미리 감사드립니다
아래와 같이 작동
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetCustomerLevel`()
BEGIN
if(select count(name) from s_marks)<4
then
select 'inside the if statement' as'';
select 'there are lassee than 4 students' as '';
else
select 'there are more than 4 stu' as '';
end if;
END
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다