如果语法错误
IF syntax error
我在遵循 IF
语法的 MySQL 指南时遇到语法错误。
我的查询是:
if 0=0 then select 'hello world'; end if;
从逻辑上讲,这应该 select 'hello world'
,但我却得到
ERROR 1064 (42000): 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 (0=0) then select 'hello world'' at line 1
ERROR 1064 (42000): 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 'end if' at line 1
我在遵循 IF
语法的 MySQL 指南时遇到语法错误。
我的查询是:
if 0=0 then select 'hello world'; end if;
从逻辑上讲,这应该 select 'hello world'
,但我却得到
ERROR 1064 (42000): 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 (0=0) then select 'hello world'' at line 1
ERROR 1064 (42000): 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 'end if' at line 1