存档

文章标签 ‘mysql’

删除wordpress中标题重复的文章

2010年12月28日 没有评论
建了一个网站,www.wangdianzhu.info,文章主要是采集来的,有一些文章被重复采集了,需要删除标题重复的记录
ok,记录一下
create table my_tmp as select min(ID) as col1 from wp_posts group by post_title;
delete from wp_posts where ID not in (select col1 from my_tmp);
drop table my_tmp;

create table my_tmp as select min(ID) as col1 from wp_posts group by post_title;delete from wp_posts where ID not in (select col1 from my_tmp); drop table my_tmp;

分类: 数据库 标签:

ECShop清理两个月未下单的代理用户

2009年9月12日 没有评论

把两个月未下单的代理用户的等级积分设为0,为普通用户

update ecs_users u set u.rank_points=0 where user_id not in (select user_id from ecs_order_info o where (UNIX_TIMESTAMP()-o.shipping_time<60 * 24 * 60 * 60))

分类: 默认分类 标签: ,