mysql - SQL语句报错
迷茫
迷茫 2017-04-17 13:40:14
0
1
638
UPDATE (SELECT  money,tb.userInfoId,yh.regTime,hy.vipStatus,hy.expirationTime,hy.grade
                    FROM (SELECT SUM(money) money,userInfoId  
                                FROM orderlist 
                                WHERE status = 2
                                GROUP BY userInfoId) tb
                    LEFT JOIN (SELECT userInfoId,grade,vipStatus,expirationTime
                                         FROM member) hy ON tb.userInfoId = hy.userInfoId
                    LEFT JOIN (SELECT regTime,userInfoId FROM userinfo) yh ON tb.userInfoId = yh.userInfoId
    WHERE money>=1000 AND hy.grade = 0) a1 SET a1.vipStatus = 1 

[Err] 1288 - The target table a1 of the UPDATE is not updatable

写得有点烂....
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
左手右手慢动作

I think it’s because: what follows your update is a result set, not a real table, so the update operation cannot be performed.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template