随笔-71  评论-5  文章-0  trackbacks-0

         select * from  table order by  id   limit    (intPage - 1) * PageRow    , intPage * PageRow




去重SQL

select product_code,count(*) as count from h_product_info group by product_code having count>1; 
select d_date,count(*) as count from h_oddnum group by d_date having count>1 order by d_date desc; 
delete from h_oddnum where id in (select min(id) from h_oddnum group by d_date having count(d_date) > 1) 
create table tmp as select min(id) as col1 from blur_article group by title;
delete from blur_article where id not in (select col1 from tmp); 
drop table tmp;
select min(id) from h_oddnum group by d_date having count(d_date) > 1
create table tmp as select min(id) as col1 from h_oddnum group by d_date having count(d_date) > 1;
delete from h_oddnum where id not in (select col1 from tmp); 
drop table tmp;
insert into h_oddnum(id,d_date,d_code) values('e1d64c5f536b4b1bbfe9f04511c01f3f','20150422172207','00001');
posted on 2015-05-19 17:12 藤本蔷薇 阅读(161) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: