cari

Rumah  >  Soal Jawab  >  teks badan

mysql - SQL语句报错

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

写得有点烂....
迷茫迷茫2781 hari yang lalu643

membalas semua(1)saya akan balas

  • ringa_lee

    ringa_lee2017-04-17 13:42:14

    我觉得是因为:你update后面跟的是个结果集,并不是真实的表,所以没法进行更新操作。

    balas
    0
  • Batalbalas