我不断收到此语法错误,但在与其他示例进行比较时找不到任何问题。
if EXISTS (select 1 from City where name = 'Perth')
THEN Print 'Record exits - Update'
ELSE Print 'Record doesn''t exist - Insert'
我发现错误:
#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 EXISTS (select
1 from City where name = 'Perth') THEN Print 'Record e' at line 1
我在zend cloud和普通的phpmyadmin mysql 5上都得到了这个