I have this query in my application:
string sql = @"UPDATE AccountGroup
SET IdGroup = @idGroup
WHERE IdAccount = @idAccount;
IF (ROW_COUNT() = 0) THEN
INSERT INTO AccountGroup (IdAccount, IdGroup)
VALUES (@idAccount, @idGroup);
END IF;"
Which gives me this error message:
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 (ROW_COUNT() = 0) THEN INSERT INTO AccountGroup (IdAccount, IdGroup)' at line 1.
What is the problem?