mysql 子查询 根据查询结果更新表
1 UPDATE 2 key_info k1, 3 (SELECT nid,nick FROM key_info WHERE adddate=CURRENT_DATE-1 and isTmall=4)k2 4 SET k1.nick=k2.nick 5 WHERE k1.nid = k2.nid AND k1.adddate=CURRENT_DATE
1 UPDATE 2 key_info k1, 3 (SELECT nid,nick FROM key_info WHERE adddate=CURRENT_DATE-1 and isTmall=4)k2 4 SET k1.nick=k2.nick 5 WHERE k1.nid = k2.nid AND k1.adddate=CURRENT_DATE