UPDATE e a, (SELECT e1,COUNT(*) cnt
FROM e
GROUP BY e1) b
SET a.e2 = b.cnt
WHERE a.e1 = b.e1;
UPDATE e a, (SELECT e1,COUNT(*) cnt
FROM e
GROUP BY e1) b
SET a.e2 = b.cnt
WHERE a.e1 = b.e1;