6,更新 pm_members 表的短消息总数
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_0`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 0 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_0`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 0 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_1`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 110 = 1 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_1`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 110 = 1 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_2`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 2 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_2`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 2 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_3`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 3 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_3`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 3 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_4`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 4 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_4`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 4 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_5`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 5 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_5`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 5 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_6`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 6 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_6`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 6 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_7`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 7 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_7`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 7 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_8`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 8 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_8`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 8 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_9`
- WHERE delstatus IN (0,1) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 9 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1), l.authorid) = m.uid;
- UPDATE `pre_ucenter_pm_members` m, (SELECT plid, count(*) as pmnum FROM `pre_ucenter_pm_messages_9`
- WHERE delstatus IN (0,2) GROUP BY plid) msg, `pre_ucenter_pm_lists` l SET m.pmnum = msg.pmnum WHERE
- m.plid % 10 = 9 AND m.plid = msg.plid AND m.plid = l.plid AND IF(SUBSTRING_INDEX(l.min_max, '_', 1)
- = l.authorid, l.authorid, SUBSTRING_INDEX(l.min_max, '_', -1)) = m.uid;