1064 error in SQL Syntax near ‘!=guildRank LIMIT 1 END’ at line 3
CREATE DEFINER=`root`@`localhost` PROCEDURE `DeleteUserGuildAttr`(IN userId INT unsigned, IN guildId INT unsigned, IN guildRank SMALLINT unsigned) BEGIN DELETE FROM guildattr WHERE id=userId AND guild_id=guildId AND rank!=guildRank LIMIT 1; END
Advertisement
Answer
MySQL 8.0 added the rank()
window function, so it is now reserved.
You need to escape it:
`rank` <> guildRank
for the condition.