Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am trying to update the value of a column where it matches a certain userid, but it keeps giving a syntax error.

UPDATE user 
   SET balance = 15000.000000000 
 WHERE id = 11203;

The table called user has many rows with two columns, balance and id. I am trying to edit the balance of the user id in the code.

share|improve this question
    
Post the create table statement. – OMG Ponies Jul 2 '12 at 20:15
up vote 17 down vote accepted

Try "user", or give a more generic name:

UPDATE "user" 
 SET balance = 15000.000000000 
 WHERE id = 11203;

or ALTER your table name to "user_list" for example. Any doubt, please check keywords

share|improve this answer
    
Worked great! Thnx. – user1449384 Jul 2 '12 at 20:23

You need to escape user since it is a reserved word. Try

UPDATE "user"
SET balance = 15000.000000000 
WHERE id = 11203;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.