开发者

How to update a field using alias in mysql?

I am having a table in mysql, and in that i am having two fields that is id and desc, now as desc is a mysql keyword, i am unable to update that field because mysql is giving syntax error, so i thought why not update that field by using alias, i used it but not working, is there any way to update that field using alias. Please help! I need it very badly. Th开发者_StackOverflow中文版anks Ravinder


Try with:

UPDATE t1 SET `desc`='NEW VAL'

Notice the single backquotes ( ` ) around the desc field name

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜