이 If 문을 작동 시키려고하지만, 원하는대로 할 수 없습니다. select @result를 수행하면 값 0을 얻습니다. 그런 다음 IF 문이 작동하지 않는 이유는 무엇입니까?mySQL If 문
SET @message = '((sometihng here))';
select LEFT(@message, 1) into @firstChar;
select STRCMP(@firstChar,'(') into @result;
IF (@result = 0) THEN
SET @message = 'true';
//more selects and cals here;
END IF;
select @message;
내가 진정한 가야하지만, 나는 그것이 나에게 오류가 표시되지 않습니다
SQL query: IF(@result =0) THEN SET @message = 'true';
MySQL은 말했다 :
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF (@result = 0) THEN SET @message = 'true'' at line 1