MySQL Forums
Forum List  »  Newbie

Help with one SQL query. (update player_storage where key xxxx set value 0)
Posted by: Stefan Brannfjell
Date: March 14, 2011 02:00PM

Hello everybody, well I am not good at scripting sql from scratch and I havent found any similar samples around, any help is highly appreciated! :)

Here is the situation:
My database have several storage values
Player ID - key - value
Sample:
(id) (key) (value)
20 - 1234 - 3

This means that player 20 have storageid 1234 with the value 3.

I believe this is a rather well used method for storing values, for scripts like.
If storageid 1234 = 3 then do something, else do nothing.

The problem:
I want to update the value of all lines that have key 1234 the value 0.

So the sample would be:
(id) (key) (value)
20 - 1234 - 0

I want the query to only update the value of key 1234. Not the other key values, and want it to affect all ids.

I thought of something like this:
update player_storage where key 1234 set value 0

But could anyone help me getting the correct sql value? I hope you understand my situation. :)

Options: ReplyQuote


Subject
Written By
Posted
Help with one SQL query. (update player_storage where key xxxx set value 0)
March 14, 2011 02:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.