mysql group by 去重 分类 求和

w

 

SELECT
    COUNT(*)
FROM
    (
        SELECT
            COUNT(*)
        FROM
            listing_vary_asins
        GROUP BY
            asin,
            countrycode
    ) AS w;


SELECT
    COUNT(*)
FROM
    listing_vary_asins
GROUP BY
    asin,
    countrycode;

 

 

 

 

分类 统计  去重 

 

SELECT MIN(id) as min_id ,COUNT(1) AS c FROM  parent_url_copy  GROUP BY CONCAT(page_url,children_url)

 

 

DELETE
FROM
	parent_url_copy
WHERE
	id IN (
		SELECT
			min_id
		FROM
			(
				SELECT
					MIN(id) AS min_id,
					COUNT(1) AS c
				FROM
					parent_url_copy
				GROUP BY
					CONCAT(page_url, children_url)
			) AS tab
		WHERE
			c > 1
	);

  

 

posted @ 2017-05-10 12:12  papering  阅读(3011)  评论(0编辑  收藏  举报