开发者

error in updating mysql table with filters

i have a mysql table with the follwoing fields :

id, desc, value, people, amount, weight

in the above order i run the follwoing

update match1 set weight = 5 where desc = 'fat' and id != '6';

follwoing is the error message i get :

**#1064 - You have an error in your SQL syntax; check the manual that** 
corresponds to your MySQL serve开发者_如何学Pythonr version for the right syntax 
to use near 'desc = 'bat' and id = 6' at line 1

can someone please let me know whats wrong with this?


the column desc is a keyword in mysql. use backquotes i.e.

where `desc` = 'fat'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜