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
精彩评论