大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 数据库 -> 其他相关 -> 解决数据库中记录重复问题

解决数据库中记录重复问题

时间: 2021-08-13 作者:daque

--产物数据反复统计 select mc, userid, count(mc) as expr1 from chanpin group by mc, userid --将不反复的记录插入新表newchanpin select * into #tmp1 from chanpin go select min(id) as autoid into #tmp2 from #tmp1 group by mc, userid go select * into newchanpin from #tmp1 where id in(select autoid from #tmp2) --搜索反复用户 --select distinct name from user_name select * into #tmp0 from user_name go select min(id) as autoid into #tmp6 from #tmp0 group by admin go select * into newuser_name from #tmp0 where id in(select autoid from #tmp6) --用户自设置类型 select userlb as expr1, userid as expr2, count(userlb) as expr3 from newuser_lb group by userlb, userid select * into #tmp8 from user_lb go select min(id) as autoid into #tmp9 from #tmp8 group by userlb, userid go select * into newuser_lb from #tmp8 where id in(select autoid from #tmp9) --用户消息 select bt, userid,count(bt) from user_news group by bt,userid select * into #tmp88 from user_news go select min(id) as autoid into #tmp99 from #tmp88 group by bt,userid go select * into newuser_news from #tmp88 where id in(select autoid from #tmp99)

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.