Mihail Znov
Mihail Znov

Reputation: 3

UPDATE price (SQL)

I need a query for MySQL...

I need change the price divided by 2 .. something like

Table name "Armor"

ID  NAME  PRICE
----------------
1   Armor  200

...and query should divide the price by 2.. Like the following (which doesn't work):

UPDATE `armor` 
   SET `PRICE` = 'PRICE/2' 

Upvotes: 0

Views: 10865

Answers (1)

NPE
NPE

Reputation: 500267

Remove the quotes: UPDATE armor SET PRICE=PRICE/2

Upvotes: 6

Related Questions