没什么快的方法 select出来结果集 放入一新表 删掉旧表 然后renameselect * from tb A where not extsts (select 1 from tb where A.url=url and A.id<id);
没什么快的方法 select出来结果集 放入一新表 删掉旧表 然后renameselect * from tb A where not extsts (select 1 from tb where A.url=url and A.id<id);URL字段当时忘记作索引了,这个select 应该会非常慢吧??主要还想统计出哪些是重复的
没什么快的方法 select出来结果集 放入一新表 删掉旧表 然后renameselect * from tb A where not extsts (select 1 from tb where A.url=url and A.id<id);URL字段当时忘记作索引了,这个select 应该会非常慢吧??主要还想统计出哪些是重复的 单纯统计哪些重复的url可以 select url from tb group by url having count(*)>1 当然要加所以才能快
select * from ( select * from table order by id desc) t group by url 直接排序后group by,取的就是每组第一条数据,也就是id最大值的那条
from aaa
group by url
where not extsts (select 1 from tb where A.url=url and A.id<id);
where not extsts (select 1 from tb where A.url=url and A.id<id);URL字段当时忘记作索引了,这个select 应该会非常慢吧??主要还想统计出哪些是重复的
where not extsts (select 1 from tb where A.url=url and A.id<id);URL字段当时忘记作索引了,这个select 应该会非常慢吧??主要还想统计出哪些是重复的
单纯统计哪些重复的url可以
select url from tb group by url having count(*)>1
当然要加所以才能快
select * from table order by id desc) t group by url
直接排序后group by,取的就是每组第一条数据,也就是id最大值的那条