1

I have a database with a rate column with numerical data. I would like to update the data in this column by adding 20 to each.

I am trying,

UPDATE 'refinance' SET 'rate' = rate + 20 

I get a syntax error when I simulate this query :

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 ''refinance' SET 'rate' = rate + 20' at line 1

Thanks for the input on this. Eric

Community
  • 1
  • 1
Zeusofolus
  • 25
  • 1
  • 5

2 Answers2

1

Please refer the update table syntax, you need to specify the tablename not table keyword.

UPDATE refinance SET rate = rate + 20; 

https://dev.mysql.com/doc/refman/5.7/en/update.html

https://www.w3schools.com/sql/sql_update.asp

Ponni
  • 433
  • 5
  • 17
0

So it turns out this query works after all, I only get the error when I press the "Simulate Query" button in phpMyAdmin when I hit the "go" button it processes without error.

I am relatively new to sql so not sure why this would be the case or what the benefit of simulation is if it is not a representation of the actual syntax. Thanks to everyone for the input and time.

Eric

Zeusofolus
  • 25
  • 1
  • 5