把结果集中某个字段更新
下面sql中 b表的parent_id = 0 && b.cat_id = a.parent_id
那么把a表的level设置为2
update category as a INNER JOIN category AS b ON a.parent_id = b.cat_id AND b.parent_id=0 set a.level = 2
把结果集中某个字段更新
下面sql中 b表的parent_id = 0 && b.cat_id = a.parent_id
那么把a表的level设置为2
update category as a INNER JOIN category AS b ON a.parent_id = b.cat_id AND b.parent_id=0 set a.level = 2