Georgi Mishev
Georgi Mishev

Reputation: 1

Error Code: 1064 - You have an error in your SQL syntax

I have a very strange problem with this code:

Update creature_template SET health_min=(health_min * 0.03) where entry in (select entry from creature where rank ='1');
Update creature_template SET health_max=(health_max * 0.03) where entry in (select entry from creature where rank ='1');

Error occured at:2021-01-07 13:27:46 Line no.:1 Error Code: 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 '='1')' at line 1

I use mysql 8.x and I am a beginner. in mysql 5.x this problem does not exist. Anyone if can help i would be grateful.

Upvotes: 0

Views: 196

Answers (1)

juergen d
juergen d

Reputation: 204756

rank is a reserved word in MySQL since version 8.0.2. You need to escape it with backticks

... where `rank` = '1' ...

Upvotes: 1

Related Questions