0
エラーを解決したい。 私はこの質問をexicutingしている間、私はエラーで会った。'IF EXISTS'付近のSynatxエラー
IF EXISTS (SELECT * FROM category_info WHERE category_name = 'Electronics')
BEGIN
select * from category_info;
END
ELSE
BEGIN
insert into category_info(category_name) values('Electronics');
END
エラー:
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 * FROM category_info WHERE category_name = 'Electronics') BEG' at line 1
私は事前のおかげ
ここをクリックしてください:https://stackoverflow.com/questions/5528854/usage-of-mysqls-if-exists –
[MySQLには存在しない場合は挿入する方法]の可能な複製(https:///stackoverflow.com/questions/1361340/how-to-insert-if-not-exists-in-mysql) – GolezTrol
[MySQLの「IF EXISTS」の使用法](https://stackoverflow.com/questions/5528854)の可能な複製/ usage-of-mysqls-if-exists) –