当前位置: 首页 > news >正文

建设行业信息和技术应用服务网站衡水网站建设选哪家

建设行业信息和技术应用服务网站,衡水网站建设选哪家,高端网站建设过程,网站开发大学是什么专业进行数据管理时#xff0c;无效数据可能会对生产力和决策质量造成严重的影响。如何发现和处理无效数据变得愈发重要。一起来唠唠你会如何处理无效数据吧~ 方向一#xff1a;介绍无效数据的概念 最近遇到了pg数据库表中的大量数据重复了#xff0c;需要删除其中的一条。一条…  进行数据管理时无效数据可能会对生产力和决策质量造成严重的影响。如何发现和处理无效数据变得愈发重要。一起来唠唠你会如何处理无效数据吧~ 方向一介绍无效数据的概念 最近遇到了pg数据库表中的大量数据重复了需要删除其中的一条。一条条删除显然不切合实际还是需要通过计算来删除。 方向二无效数据的处理方法 实施步骤 1.对原表进行备份 2.使用一个表结构完全一样的临时表对原始表进行接收。 create  table  tmp_0524_1  as  select  * from  public.m_user_bak20230524; 3.找出重复的数据 drop  table  tmp_0524_2; create  table  tmp_0524_2  as select * from  ( select  phone ,count(1) cn  from  tmp_0524_1  where  phone is  not  null   group  by phone ) t where t.cn 1  ; 4.用第二个临时表接收数据 drop  table  tmp_0524_3_1; create  table  tmp_0524_3_1  as select   t.* from  tmp_0524_1  t  where  phone  in (select phone  from  tmp_0524_2 ) and  opt_user is null; 5.建一个表结构一样的空表多增加一个iid字段 create table  tmp_0524_3 as  select  iid , t.* from  tmp_0524_3_1 where 1 2; 6.给空表增加一个iid字段建立一个字段自增 CREATE SEQUENCE tmp_0524_3_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; alter table tmp_0524_3  alter column iid set default nextval(tmp_0524_3_id_seq);  7.插入数据 INSERT INTO public.tmp_0524_3 (id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company) select id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company from  tmp_0524_3_1; 8.删除相同数据中的一条 DELETE FROM tmp_0524_3 WHERE iid NOT IN ( SELECT max(iid) FROM tmp_0524_3 GROUP BY  phone ); 9.删除原始表中的有相同数据的数据 delete from  m_user where  phone in (select phone from  tmp_0524_3); 10.将处理好的数据插回原始表 INSERT INTO public.m_user (id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company) select id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company from  tmp_0524_3;   方向三如何减少无效数据 在并发系统中应该增加锁对数据进行插入避免重复的插入数据。 方向四实际案例举例 案例 最近遇到了pg数据库表中的大量数据重复了需要删除其中的一条。一条条删除显然不切合实际还是需要通过计算来删除。 实施步骤 1.对原表进行备份 2.使用一个表结构完全一样的临时表对原始表进行接收。 create  table  tmp_0524_1  as  select  * from  public.m_user_bak20230524; 3.找出重复的数据 drop  table  tmp_0524_2; create  table  tmp_0524_2  as select * from  ( select  phone ,count(1) cn  from  tmp_0524_1  where  phone is  not  null   group  by phone ) t where t.cn 1  ; 4.用第二个临时表接收数据 drop  table  tmp_0524_3_1; create  table  tmp_0524_3_1  as select   t.* from  tmp_0524_1  t  where  phone  in (select phone  from  tmp_0524_2 ) and  opt_user is null; 5.建一个表结构一样的空表多增加一个iid字段 create table  tmp_0524_3 as  select  iid , t.* from  tmp_0524_3_1 where 1 2; 6.给空表增加一个iid字段建立一个字段自增 CREATE SEQUENCE tmp_0524_3_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; alter table tmp_0524_3  alter column iid set default nextval(tmp_0524_3_id_seq);  7.插入数据 INSERT INTO public.tmp_0524_3 (id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company) select id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company from  tmp_0524_3_1; 8.删除相同数据中的一条 DELETE FROM tmp_0524_3 WHERE iid NOT IN ( SELECT max(iid) FROM tmp_0524_3 GROUP BY  phone ); 9.删除原始表中的有相同数据的数据 delete from  m_user where  phone in (select phone from  tmp_0524_3); 10.将处理好的数据插回原始表 INSERT INTO public.m_user (id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company) select id, user_id, phone, user_name, id_card, wx_account, state, app_id, app_name, head_icon, sex, sex_name, reg_time, user_state, user_state_name, open_id, opt_user, birthday_type, birthday, org_name, last_trading_time, org_code, union_id, orig_phone, update_time, belong_code, belong_name, data_type, client_num, client_name, country_code, inviter, channel_id, channel_name, company from  tmp_0524_3;
http://www.hkea.cn/news/14436646/

相关文章:

  • 建设银行网站储蓄账户查询密码河池网站优化
  • 大数据比赛网站建设网站页脚的信息都有什么
  • 长虹电视网站建设中南宁seo推广
  • 大型做网站的公司网站上线确认书
  • 广元市利州区建设局网站百度信息流推广是什么意思
  • 建设公司怎么做网站运营室内设计好的大学排名
  • wap网站设计营销软件排名
  • 大连网站设计策划php网站开发 在本地修改 服务器源文件同步
  • app网站建设需要什么软件国内最厉害的公关团队
  • 做logo去哪个网站怎么做网站排名会更好
  • 网站建设类行业资讯前端开发有前途吗
  • 网站宣传的好处莱芜新闻电视台节目表
  • 广安住房和城乡建设厅网站lamp网站架构
  • 山东省建设工程注册中心网站甘肃肃第八建设集团网站1
  • 企业手机网站建设策划网优 是什么网站
  • 网站开发方案及报价中山免费建站
  • 国内最有趣的网站营销云
  • 深圳联雅网站建设招聘模板图片
  • 视觉中国设计网站移动端网站开发介绍
  • 房产交易网站开发广州建站网络公司
  • 创建网站需要学什么知识微 网站
  • 建设银行投诉网站博客和个人网站建设情况
  • 什么网站可以做直播用哪个软件制作网页
  • 老河口建设局网站如何破解网站后台
  • 做一般的公司门户网站投资额wordpress酒店主题
  • 网站开发行业推广淘宝毕业设计网站代做
  • 什么语言做网站app开发技术
  • 网站制作公司 知乎产品推广方案推广思路和方法
  • 做百度移动网站点击wordpress 全站加密
  • 述建设一个网站的具体步骤建站seo是什么