mysql常用sql命令语句列表(菜鸟专用)

记录一下常用的sql语句,方便随时使用:

计算一列的和值:

select sum(userfen) from phome_enewsmember

将一列的值加到另外一列上
update phome_enewsmember set userfen=userfen+income*0.6

将phome_ecms_news的xiazai字段所有值设置为如下链接

update phome_ecms_news set xiazai='https://ugame.9game.cn/game/downloadGame?pack.cooperateModelId=215453&pack.id=40616664'

带条件替换,比如栏目为17的

update www_kaifamei_com_ecms_download set xiazai='https://ugame.9game.cn/game/downloadGame?pack.cooperateModelId=215453&pack.id=40616664' where classid=17