I keep getting this syntax error but can't find anything wrong with it when comparing to other examples.
if EXISTS (select 1 from City where name = 'Perth')
THEN Print 'Record exits - Update'
ELSE Print 'Record doesn''t exist - Insert'
I find error:
#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
I get this both on zend cloud and normal phpmyadmin mysql 5