Update column value PostgreSQL

前端 未结 2 647
名媛妹妹
名媛妹妹 2020-12-30 18:30

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 =         


        
相关标签:
2条回答
  • 2020-12-30 18:54

    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

    0 讨论(0)
  • 2020-12-30 18:54

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

    UPDATE "user"
    SET balance = 15000.000000000 
    WHERE id = 11203;
    
    0 讨论(0)
提交回复
热议问题