标签:去重 sel blog xxx from union style logs _id
DELETE FROM xxx WHERE id NOT in( SELECT tmp.id FROM(SELECT id,COUNT(id) AS cnt FROM xxx GROUP BY ticket_id,ota_id HAVING cnt>1)tmp UNION ALL SELECT tmp2.id FROM (SELECT id,COUNT(id) AS cnt FROM xxx GROUP BY ticket_id,ota_id HAVING cnt=1)tmp2)
标签:去重 sel blog xxx from union style logs _id
原文地址:http://www.cnblogs.com/flydkPocketMagic/p/7447119.html