I want to solve an error. While i am exicuting this query i met with an error.
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
Error:
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
I need help,Thanks in advance