sql 优化 临时表 差集
SELECT DISTINCT(h.UserId) FROM UserHistory h
LEFT JOIN User u ON h.UserId=u.Id
WHERE u.BizStatus=2;
SELECT UserId FROM ( SELECT DISTINCT(h.UserId) FROM UserHistory h ) AS t
LEFT JOIN User u ON t.UserId=d.Id WHERE u.BizStatus=2;